On 8/8/2011 4:24 AM, Johan Björk wrote:
This has been discussed a billion times, so I'll keep it short.

Problem: Some parts of the build requires a environment variable to be set
Solution: Several workarounds, use custom commands, wrapper scripts etc.

While the solution works fine for basic stuff, I have several toolchains
> etc that requires environment variables to be installed for them to work.

CMake has always assumed that the environment is setup correctly for the
desired toolchain before either cmake or make runs.  Typically developers
have dealt with this by naming the build tree after the toolchain needed
as a reminder of the environment needed.  I'm sure an alternative would
be welcomed by many.

Since I'm using cmake --build for all my building, I am thinking about
> creating a new command in cmake that will store certain environment
> variables in the cache, and if building using cmake --build, they will
> be set before the build starts.

This sounds like a great compromise.  I don't think the cache is the
right place to put this though.  I think you can create your own file
like CMakeFiles/cmake--build.env and give it a format customized for
this purpose (like one line per variable or something).

Please post a proposed interface here first for adding/setting/removing
variables from the environment configuration.

Thanks,
-Brad
_______________________________________________
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to