[CMake] Setting Environment Variables on Windows (UNCLASSIFIED)

Sklar, Emerson (Cont, ARL/CISD) emerson.sklar at arl.army.mil
Thu Jan 7 11:36:31 EST 2010


Classification:  UNCLASSIFIED 
Caveats: NONE
 
Fellow Cmake Users-
I am trying to set environment variables (namely PATH and PYTHONPATH) on
Windows during test execution. I utilize a configuration script which gets
converted from a .cmake.in to .cmake, then is used to call each of my tests.
The top of my .cmake.in looks as follows:

SET(TESTARG /path/to/whatever)
MESSAGE("TESTARG" ${TESTARG})
SET(ENV{PYTHONPATH} $ENV{PYTHONPATH}: TESTARG)
MESSAGE("PYTHONPATH:" $ENV{PYTHONPATH})

On Linux, this works perfectly. On Windows, however, there is no apparent
change to the environment variables (NOTE: I do change the ':' on Linux to
';' for Windows). It will output:

Linux:
TESTARG /path/to/whatever
PYTHONPATH: /whatever/my/python/path/was:/path/to/whatever

Windows:
TESTARG
PYTHONPATH: /whatever/my/python/path/was


It IS at least parsing through the commands, because if I put in a totally
invalid value to the SET command it will fail. It simply does not set either
the TESTARG (Cmake env. Variable) or PYTHONPATH (system env. Variable).
Has anyone had any luck setting environment variables on Windows?

Thanks for the assistance.


Emerson Sklar
Computer Scientist, High Performance Technologies, Inc.
<http://www.hpti.com/> 

Army Research Lab
Building 394 Room 202E
APG, Maryland 21005

Office: (410) 278-9151
Cell: (304) 203-8872

 
Classification:  UNCLASSIFIED 
Caveats: NONE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100107/3f2dd05e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5297 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100107/3f2dd05e/attachment.bin>


More information about the CMake mailing list