[CMake] ctest - how to set environment

Jörg Becker news at elke-joerg.de
Wed Feb 20 11:36:50 EST 2008


On Wednesday, 20. February 2008 16:48:39 Bill Lorensen wrote:
> You can set the CTEST_ENVIRONMENT as it does:

As I wrote in my first mail, I'm failed using CTEST_ENVIRONMENT inside a 
CMakeLists.txt. I have not tried this in a special ctest script because I'm 
searching for lean solution. Which means write a 'CMakeList.txt' once, 
run 'cmake' once and be able to run 'make test' for every change on my 
software. My problem is: there is make test target, I want to use it, but all 
tests fail because of the missing environment variables.

Maintaining a ctest script besides the CMakeLists.txt is too much effort for 
my current purpose. As described in 
http://www.cmake.org/Wiki/CMake_Testing_With_CTest "Simple Testing"
("The easiest way to create CTest input files is using CMake."), I just want 
to generate / call the tests within the build process (with the existing test 
target), and not define/maintain a parallel build/test process. 

Jörg


More information about the CMake mailing list