title: Xcode xcconfig: Configuring a dependency based on the target
body: <p>In the quest to resolve the Objective-C <a href="https://stackoverflow.com/questions/1474626/objective-c-function-dispatch-collisions-or-how-to-achieve-namespaces">namespace</a> <a href="https://stackoverflow.com/questions/178434/what-is-the-best-way-to-solve-an-objective-c-namespace-collision">issue</a> I'd like to experiment with prefixing a dependency's Objective-C classes based on the target being built.</p>
  
  <p>As an example, suppose I have in my shared library (<code>ObjCStaticLib</code>) a class (<code>CWindow</code>). I have two plugins (<code>A</code> and <code>B</code>) that will use this <code>CWindow</code>. To avoid <code>A</code>'s <code>CWindow</code> from colliding with <code>B</code>'s <code>CWindow</code>, I want to prefix the <code>CWindow</code> class name at compile time, so <code>A</code>'s <code>CWindow</code> becomes <code>ACWindow</code> and <code>B</code>'s becomes <code>BCWindow</code>.</p>
  
  <p>I'm looking for a way to communicate to <code>ObjCStaticLib</code> at compile time what prefix it should use to compile itself with. I'm thinking about using <a href="http://developer.apple.com/mac/library/DOCUMENTATION/DeveloperTools/Conceptual/XcodeBuildSystem/400-Build_Configurations/build_configs.html" rel="nofollow noreferrer">xcconfigs</a> to specify a preprocessor macro that the leaf target customizes and that <code>ObjCStaticLib</code> uses. However, I'm not aware of a way for a target to "communicate" with a dependency like that.</p>
  
  <p>I can modify all the sources/projects/etc involved as necessary to implement per-client namespace customization in a dependency.</p>
  
  <p>Does anyone have a good solution for this?</p>