CTEST_ENVIRONMENT cannot be used from within CMakeLists.txt -- it is a &quot;ctest -S script&quot; only variable...<div><br></div><div>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.<br>

<br></div><div>With CVS or the upcoming CMake 2.8, after calling ADD_TEST in your CMakeLists.txt file, you can do:</div><div><div>  set_property(TEST TestName PROPERTY</div><div>    ENVIRONMENT &quot;CMAKE_ENVIRONMENT_TEST_VAR=Happy Thanksgiving!&quot;</div>
<div>  )</div><div><br></div></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">On Wed, Sep 9, 2009 at 12:04 PM, Roland Bock <span dir="ltr">&lt;<a href="mailto:rbock@eudoxos.de" target="_blank">rbock@eudoxos.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I would like to set some environment variables for ctest which are set when I call<br>
<br>
make test<br>
<br>
but not when I call<br>
<br>
make foo<br>
<br>
<br>
I have read that in a ctest script, I can do this by<br>
<br>
SET (CTEST_ENVIRONMENT &quot;foo=bar&quot;)<br>
<br>
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)?<br>
<br>
<br>
Thanks and regards,<br>
<br>
Roland<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>