You didn't mention what operating system you're using, but on Linux, at least, the second thing you asked for:<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">
I also tried running the envsetup script alone by using the cmake -P
command, when the script runs it set the values and outputs it
correctly, however after the script finishes execution the environment
is still unchanged. I want to set the environment variables permanently.<br></blockquote>
<br>... is impossible. You cannot run any command in a Unix shell and have it modify the shell's environment. I believe on Windows this is possible, but I'm not sure.<br><br>As for the first thing, though:<br><br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I was trying to setup my environment variables before i start a build , but they do not seem to be working at all. I basically have a Ctest script called driver.ctest which includes another file called envsetup at the beginning.<br>
<br>
envsetup contains a list of set(ENV{VAR1} VALUE) and sometimes a few execute_process calls which store the output into an environment variable. However once the driver.ctest script gets to the building part the build fails as the environment variables are not set properly.<br>
</blockquote><div><br>I just tested this out locally and it worked fine for me. When you say that you "include another file called envsetup", do you literally mean INCLUDE("envsetup.cmake") in your driver script? If so, that should work, and it does work for me here - I modified one of my driver scripts to do this, and confirmed that the variable was set in the environment for both the ctest_configure and ctest_build steps.<br>
<br>Can you reduce this to a small example, maybe?<br><br>Ceej<br>aka Chris Hillery<br></div></div>