I added a subproject (a library) to my project.
In order to be able to import the header files of the subproject, I'm adding the absolute path to the subproject directory (recursive) to the "Header Search Paths" of my main project. Is there anyway to configure XCode to automatically/ dynamically recognise the path to my subproject directory?
I feel that what I'm doing right now is very manual and prone to human errors. Also, in case I moved my subproject, I will not be able to import its header files anymore.
Note that I don't want to put the subproject directory inside the same directory with the main project as it will be reused for many different projects.
The reason why I expected this functionality of XCode are:
You can use a relative directory, as opposed to an absolute directory, by using $(PROJECT_DIR)
, which is one of Xcode's many variables.
Assuming the sub-project is in a sibling directory to the app project (a system I use myself), then set Header Search Path to (something like):
$(PROJECT_DIR)/../libproject/include
This will allow the project to exist anywhere in the filesystem, provided the project directories maintain the same relative path to each other.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With