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:<br><br>CMake Error: cmake version 2.6-patch 2<br>Usage: /home/daniel/Public/cmake-2.6.2/bin/cmake -E [command] [arguments ...]<br>Available commands: <br>  chdir dir cmd [args]...   - run command in a given directory<br>
<br>Which means that I can not call cmake -E with a cmake-sript. Do I do anything wrong? Should it be possible to feed cmake -E with a cmake-script?<br><br>Regards Daniel Carlson<br><br><div class="gmail_quote">2009/3/26 James Bigler <span dir="ltr">&lt;<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">So far as I know, the only way to set an environment variable during<br>
build time is to create a script during runtime that sets the<br>
environment variable and executes a command.<br>
<br>
configure_file(template.cmake runmycommand.cmake)<br>
<br>
add_custom_command(OUTPUT somefile<br>
  COMMAND ${CMAKE_COMMAND} -E ${template.cmake}<br>
  )<br>
<br>
and template.cmake would be:<br>
<br>
set(ENV{SOME_ENV_VAR} &quot;${SOME_ENV_VAR_VALUE}&quot;)<br>
execute_process(COMMAND ${CMAKE_C_COMPILER} some args)<br>
<br>
James<br>
<div><div></div><div class="h5"><br>
On Thu, Mar 26, 2009 at 1:49 PM, Carlson Daniel<br>
&lt;<a href="mailto:daniel.c.carlson@gmail.com">daniel.c.carlson@gmail.com</a>&gt; wrote:<br>
&gt; Hi!<br>
&gt;<br>
&gt; I want to set an environment variable that is used to state the license file<br>
&gt; for my compiler. But, if I use the set-function the environment variable<br>
&gt; will be cleared when cmake terminates. Is there a way to set an environment<br>
&gt; variable at make file execution time?<br>
&gt;<br>
&gt; Daniel Carlson<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;<br>
</blockquote></div><br>