[CMake] Set environment variable

David Cole david.cole at kitware.com
Wed Jan 25 09:14:42 EST 2006


Try:

SET(ENV{MYVAR} myvalue)

(with no "$"...) The "$" causes substitution...

Xavier Delannoy wrote:

>Hi all, 
>
>My tests require some environment variable
>
>I try to set my env. var with: 
>SET($ENV{MYVAR} myvalue)
>ADD_TEST(testname ${EXECUTABLE_OUTPUT_PATH}/test1)
>
>but this doesn't work, all my tests failed because environement variable aren't set ;(
>
>So, how to set some environment variable before running test.
>
>regards,
>
>  
>


More information about the CMake mailing list