Search paths for headers in Xcode. Can I set macros or variables to refer to the SDK version?

Update: It seems that a recent Xcode update may have changed this macro, see this question and answer for more information: Getting the older SDKROOT behavior in Xcode


Situation: I am using libxml2 in an iPhone project and I added it regarding the SDK version. However, in order to actually use it in the project, it must be added to the header search path in the project settings.

I would like it to be the full version of the SDK version, so the header search path should also be relative to the SDK version, however there is no obvious way to expand the variable representing the SDK folder.

For example, here is the actual literal:

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include/libxml2

I would like to express

$ MAGICAL_BASE_SDK_VARIABLE / USR / include / libxml2

Is this something that can be done with Xcode?

+6
header-files iphone xcode libxml2
source share
1 answer

The figures show that I found out one hour after the fight against it and only 3 minutes after its publication.

The macro used in this situation is $ {SDKROOT}. Therefore, all that needs to be done is to add a header search path, for example: "$ {SDKROOT} / usr / include / libxml2", and it will be resolved accordingly.

Note that the code is not yet fully working, but it clearly shows that it at least collects the location of the header files.

+18
source share

All Articles