Ok, here's what I've tried.
I have the header files in two separate directories IRL. They're named the same, but are in two different locations.
I want to only include the relevant header file for each target. Lets say for ease of explaination that the header file is called "Config.h".
So I have:
${PRODUCT_DIR}/Header1/Config.h
and
${PRODUCT_DIR}/Header2/Config.h
These files appear in the LHS of Xcode as well in two different groups (Header1 and Header2 which point to the IRL folders).
So now all I need to do is to make Xcode choose the right one from the right folder for each target.
Target1
and
Target2
I have tried adding the path to the User Header Search Paths
for each target, but its still choosing the wrong one. I've also tried toggling "Always search user paths" which also doesn't seem to have an effect.
So my question is, is this because they're in the Project directory? Or is it because they're in Xcode in the file manager on the LHS, so therefore Xcode is copying them into the build folder?
The strange thing is it seems to be choosing the header files from the folder with the last name alphabetically...
In previous versions of Xcode I'm sure you could choose which headers to copy into the build folder.
Anyway.. does anyone know how I can fix this so that I can have it select the proper header file for the target?
Many thanks.
I have 4 targets in 1 proyect and more than 40 headers, the best solution in XCode 8 I think the best solution is change the following tag:
Always Search user Paths
To yes an all was fine for me:
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