title: Getting XCode to include, compile and link existing (C++) codebase in XCode 4.3(.1)
body: <p>I'm trying to 'import' my existing C++ codebase into my XCode iOS project.</p>
  
  <p>Problem is, xCode won't compile (and therefore not link) my code.
  This is what I've done so far:</p>
  
  <ul>
  <li>File > Add files to "Project".  I don't tick 'Copy files' since it's a shared codebase for multiple platforms and multiple copies of source code is not an option.</li>
  <li>I've added appropriate path to the "Header Search Path" project settings.  Including header files works, I can #include "stuff.h" from my Objective-C++ (.mm) file.</li>
  </ul>
  
  <p>However, I can't find any way of actually telling XCode to compile the .cpp files? </p>
  
  <p>A few points:</p>
  
  <ul>
  <li>I'm not looking for a way to pre compile it into a library and linking that way</li>
  <li>The project is a standard iOS Objective-C project.  The C++ code is called from it (that's not a problem)  </li>
  </ul>
  
  <p><strong>Update</strong></p>
  
  <p>I've added the codebase <strong>directory</strong> to the target's "Compile Sources".  I actually have to click "Add other..." in the dialog that pops up, since I can't select the directory reference to my codebase.</p>
  
  <p>When I add it, XCode asks me if I want to "Create external build system project".  I leave it ticked and the two fields with the default values "/usr/bin/make" and "$(ACTION)".  However, my codebase doesn't get compiled during the build.  Do I have to write my own Makefile ? </p>
  
  <p>If I don't select "Create external build system project" then a directory reference is created under the target, but not compiled during the build and a warning is emitted:</p>
  
  <pre><code>warning: no rule to process file '$(PROJECT_DIR)/../codebase'
  of type folder for architecture i386
  </code></pre>