[CMake] set CTEST_ENVIRONMENT from within CMakeLists.txt?

David Cole david.cole at kitware.com
Thu Sep 10 07:42:16 EDT 2009


CTEST_ENVIRONMENT cannot be used from within CMakeLists.txt -- it is a
"ctest -S script" only variable...
To do what you want, you will have to use CVS CMake, or wait until CMake 2.8
and then use the ENVIRONMENT test property.

With CVS or the upcoming CMake 2.8, after calling ADD_TEST in your
CMakeLists.txt file, you can do:
  set_property(TEST TestName PROPERTY
    ENVIRONMENT "CMAKE_ENVIRONMENT_TEST_VAR=Happy Thanksgiving!"
  )


HTH,
David


On Wed, Sep 9, 2009 at 12:04 PM, Roland Bock <rbock at eudoxos.de> wrote:

> Hi,
>
> I would like to set some environment variables for ctest which are set when
> I call
>
> make test
>
> but not when I call
>
> make foo
>
>
> I have read that in a ctest script, I can do this by
>
> SET (CTEST_ENVIRONMENT "foo=bar")
>
> But the same line does not seem to have any effect when I put it in my
> CMakeLists.txt file. Any ideas? Or is this a 2.6 feature (I am still using
> cmake 2.4 on Ubuntu-8.04 64bit)?
>
>
> Thanks and regards,
>
> Roland
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090910/badf566a/attachment.htm>


More information about the CMake mailing list