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"><<a href="mailto:jamesbigler@gmail.com">jamesbigler@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;">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} "${SOME_ENV_VAR_VALUE}")<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>
<<a href="mailto:daniel.c.carlson@gmail.com">daniel.c.carlson@gmail.com</a>> wrote:<br>
> Hi!<br>
><br>
> I want to set an environment variable that is used to state the license file<br>
> for my compiler. But, if I use the set-function the environment variable<br>
> will be cleared when cmake terminates. Is there a way to set an environment<br>
> variable at make file execution time?<br>
><br>
> Daniel Carlson<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <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:<br>
> <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>
><br>
</blockquote></div><br>