You could detect that your desired env vars are empty in your CMakeLists.txt and have CMake emit an error.<br><br>IF("$ENV{my_env_var}" STREQUAL "")<br> MESSAGE(FATAL_ERROR "error: required env var not set - please set my_env_var in your environment before running cmake/make/make test")<br>
ENDIF("$ENV{my_env_var}" STREQUAL "")<br><br>Then at least all your developers would know early on that they have to set env vars before running your cmake/make/make test sequence.<br><br><br><div><span class="gmail_quote">On 2/20/08, <b class="gmail_sendername">Jörg Becker</b> <<a href="mailto:news@elke-joerg.de">news@elke-joerg.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wednesday, 20. February 2008 16:48:39 Bill Lorensen wrote:<br> > You can set the CTEST_ENVIRONMENT as it does:<br> <br> <br>As I wrote in my first mail, I'm failed using CTEST_ENVIRONMENT inside a<br> CMakeLists.txt. I have not tried this in a special ctest script because I'm<br>
searching for lean solution. Which means write a 'CMakeList.txt' once,<br> run 'cmake' once and be able to run 'make test' for every change on my<br> software. My problem is: there is make test target, I want to use it, but all<br>
tests fail because of the missing environment variables.<br> <br> Maintaining a ctest script besides the CMakeLists.txt is too much effort for<br> my current purpose. As described in<br> <a href="http://www.cmake.org/Wiki/CMake_Testing_With_CTest">http://www.cmake.org/Wiki/CMake_Testing_With_CTest</a> "Simple Testing"<br>
("The easiest way to create CTest input files is using CMake."), I just want<br> to generate / call the tests within the build process (with the existing test<br> target), and not define/maintain a parallel build/test process.<br>
<br><br> Jörg<br> _______________________________________________<br> CMake mailing list<br> <a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br> <a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br>