如何引用带有环境变量的文件? [英] How to reference files with environment variables?
问题描述
我想知道有人是否在XCode(我的:v3.2.1)中使用环境变量来引用文件(头或lib)?
I was wondering if someone manage to reference files (except headers or lib) with an environment variable in XCode (mine : v3.2.1) ?
有设置为头(HEADER_SEARCH_PATHS),libs(LIBRARY_SEARCH_PATHS)甚至碳资源(REZ_SEARCH_PATH)指定搜索路径。但是如何引用其他文件类型的资源来为开发环境设置提供更多的灵活性?
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?
理想情况下,我想包含$(MY_RESOURCE)/myResourceFile.foo
Ideally, I would like to include $(MY_RESOURCE)/myResourceFile.foo.
解决方案是强制每个开发人员将env var添加到Xcode首选项 - >源树。我想要完全相同的行为,但嵌入在.pbxproj中。
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.
另一种解决方案,更灵活,但更少的可维护性将是创建一个组,添加文件。关闭XCode,编辑pbxproj并使用env var更改路径。
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 ?
推荐答案
我发现了一个技巧:
- 创建一个与
- 使用源代码树引用您的数据。
- 删除源代码树。
这篇关于如何引用带有环境变量的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!