I am trying to figure out how to set up environment variables to be used by my Xcode projects when compiling and linking. For example, I would like to set up header search paths and paths to static libraries that are relative to some location defined
by an environment variable.
This is easy enough to do by setting up the values in ~/.MacOSX/environment.plist or by setting them up in Xcode preferences. However, these solutions set the environment variables to the same values for all projects. I need a more flexible solution.
For example, we might have a branch in source control that needs to link to one version of a library and another branch that needs to link to a newer version. I am currently just hardcoding the correct paths in the project files themselves. This addresses
our needs, since we can have different versions of the projects (with the appropriate paths hardcoded) checked into the different branches. However, it can be error prone/time consuming. If paths need to change, we need to change them in several places in
many projects.
It would be great if there were some way of setting just a few environment variables in a file (the workspace file would be ideal) that could be checked into source control along with the rest of the code/projects/etc.
Is anyone aware of a way to accomplish this?
Thanks,
Chris
|