How to reference files with environment variables?
I was wondering if someone manage to reference files (except headers or lib) with an environment variable in XCode (mine : v3.2.1) ?
There are settings that specify search paths for headers (HEADER_SEARCH_PATHS), libs (LIBRARY_SEARCH_PATHS), and even Carbon Resource (REZ_SEARCH_PATH). But how can I reference other file types for resources to have more flexibility for the development environment setup?
Ideally, I would like to include $(MY_RESOURCE)/my开发者_高级运维ResourceFile.foo.
A solution would be to force every developer to add the env var to Xcode Preferences->Source Trees. I would like to have exactly the same behavior but embedded in the .pbxproj.
Another solution, more flexible, but less maintainable would be to create a group, add files. Close XCode, edit the pbxproj and change the path with the env var.
Do someone have another simpler solution ?
I found a trick :
- Create a source tree with exactly the same name as the environment variable you want to use.
- Reference your data using the source tree.
- Delete the source tree.
精彩评论