what would correct "User Header Search Path" be for this scenario (use of 3rd party library)
What would correct "User Header Search Path" be for this scenario (use of 3rd party library):
Notes:
- directory structure: MyApp directory is at same level as the ALibrary directory. That is I've put the source code project for the 3rd party library not within my app directory, but at the same level
- there is one 开发者_运维百科main header file which brings together all other headers from the library in the directory: "LibraryAppPath/src/core/headers".
Query Points - would be good if in the answer you could clarify the following items (which I'm a bit confused about)
- I see usage of $(BUILT_PRODUCTS_DIR) a lot. What does $(BUILT_PRODUCTS_DIR) actually resolve to? i.e. which directory
- do I need to use "$(BUILT_PRODUCTS_DIR)” as a starting point and then use multiple "../" entries to back out to a subdirectory above my app?
- I was assuming I should probably set a search path to somewhere high up in the library and then enable "Always Search User Paths"...would this be a good way to go?
- I have read using "User Header Search Path" currently may be better than using "Header Search Paths" as the former is currently ensuring code completion works. Is this ok / are there any negatives to using "User Header Search Path"?
- Is there a quick way to check in XCode that I've got the right search path in place? A way to tell it's picking up the header files I expect.
- Of course the main question is - What would correct "User Header Search Path" be for my scenario.
thanks
For Xcode 4.x, you can check the value of $(BUILT_PRODUCTS_DIR)
easily by adding a custom build phase and having it add the environments to the build log.
- Go to "Target", and "Build Phases";
- Down at the lower right, click "Add Build Phase";
- Select "Add Run Script"; the script itself is empty, so it won't actually do anything;
- Make sure the "Show environment variable in build log" option is checked;
- Build the project
Now, when you check the build log, the environment variables will all be there (if you expand the build log stage's detail).
After noting that the build process directories are different now in XCode 4, and with help from the three20 doco at http://three20.info/article/2011-03-10-Xcode4-Support I have noted that what has worked is as follows. Hence I assume this approach would work for other libraries.
"$(BUILT_PRODUCTS_DIR)/../three20"
"$(BUILT_PRODUCTS_DIR)/../../three20"
Feel free to comment / supply a better answer if there is one.
精彩评论