Search code examples
xcodexcodebuild

Xcode source code directory


Goodday!

  • ToDo: compile the files from a directory that is outside of my Xcode project. How to tell Xcode the path to look for source codes to compile (like the VPATH in a makefile)?

Note1: Right-click the target and it is easy to add the search path for header files or lib, but there I havent found any option to add a new source code directory.

Note2: I havnt found an answer in the xcode build documentation for this issue.

P.S.: I hope that I can do it without copying all the files to the xcode explicitly.

Thank you!


Solution

  • Drag the directory containing the files into your Xcode project. The only way Xcode knows it needs to compile the files is if they are contained in the project and a part of the target.