[CMake] Setting Environment Variables on Windows (UNCLASSIFIED)

Ryan Pavlik rpavlik at iastate.edu
Thu Jan 7 13:39:51 EST 2010


Hello -

This might help - from http://www.vtk.org/Wiki/CMake_Scripting_Of_CTest

# set any extra environment variables to use during the execution of
the script here:
SET (CTEST_ENVIRONMENT
)

My guess is it creates an empty/default environment when running tests
(rather than inheriting), and you need to pass in anything specific if you
want otherwise.

Hope this helps!

Ryan

On Thu, Jan 7, 2010 at 10:36 AM, Sklar, Emerson (Cont, ARL/CISD) <
emerson.sklar at arl.army.mil> wrote:

>  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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpavlik at iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100107/51ef1a54/attachment.htm>


More information about the CMake mailing list