[CMake] Setting environment variables

Johny Johny.Jose at cern.ch
Tue Sep 14 06:05:43 EDT 2010


Hey,

I was trying to setup my environment variables before i start a build , 
but they do not seem to be working at all. I basically have a Ctest 
script called driver.ctest which includes another file called envsetup 
at the beginning.

envsetup contains a list of set(ENV{VAR1} VALUE) and sometimes a few 
execute_process calls which store the output into an environment 
variable. However once the driver.ctest script gets to the building part 
the build fails as the environment variables are not set properly.

I also tried running the envsetup script alone by using the cmake -P 
command, when the script runs it set the values and outputs it 
correctly, however after the script finishes execution the environment 
is still unchanged. I want to set the environment variables permanently.

Is there some way to do this ?

Cheers
Johny



More information about the CMake mailing list