[CMake] Setting environment variables?

Brad King brad.king at kitware.com
Mon Nov 1 21:13:30 EST 2004


Lars Pechan wrote:
> I gather you can read environment variables using the $ENV{VARNAME} 
> notation.
> 
> Is it also possible to set an environment variable and if so, how?

There is no way to set an environment variable through CMake right now. 
  Setting one could be tricky because CMake is not running during the 
build.  Therefore the generated build system would have to set the 
variable.  This would translate into a make variable assignment for 
Makefile generators.  Something else would have to be done for VS 
project files.  You can add it as a feature request if you like:

http://www.cmake.org/Bug

-Brad


More information about the CMake mailing list