I just tested to run a cmake script with the -P option and the environment variable is still cleared when the script terminates... <br><br>A nice solution to my problem would be to simply extend the set-command with an option like:<br>
<br>set(ENV_KEEP{VAR} some_info)<br><br>which means that the environment variable VAR will be set to 'some_info' and will NOT will be cleared when the script is terminated. What do you think about this? would this be possible?<br>
<br>//Daniel<br><br><div class="gmail_quote">2009/3/29 Carlson Daniel <span dir="ltr"><<a href="mailto:daniel.c.carlson@gmail.com">daniel.c.carlson@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks, but I do not think this is what I want. set($ENV{VAR} "some_data") in a cmake-script will set an enviroment variable AND delete it when the script terminates. Is this not true when using -P? Do I actually need an execute_process-command (or anything else) in my script that will set the environment variable?<br>
<br><br><div class="gmail_quote">2009/3/29 Philip Lowman <span dir="ltr"><<a href="mailto:philip@yhbt.com" target="_blank">philip@yhbt.com</a>></span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div>On Sun, Mar 29, 2009 at 9:04 AM, Carlson Daniel <span dir="ltr"><<a href="mailto:daniel.c.carlson@gmail.com" target="_blank">daniel.c.carlson@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello and sorry for my late response!<br><br>I can not get this to work. When i execute the command COMMAND ${CMAKE_COMMAND} -E ${template.cmake}<br>
I get an error saying something like:</blockquote></div><div><br>I believe there was a minor typo in the post. The flag you probably want is "-P" which is "process script mode".<br><br><a href="http://www.cmake.org/cmake/help/cmake2.6docs.html#section_Usage" target="_blank">http://www.cmake.org/cmake/help/cmake2.6docs.html#section_Usage</a><br>
<br></div></div>-- <br><font color="#888888">Philip Lowman<br>
</font></blockquote></div></div></div><br>
</blockquote></div><br>