<div class="gmail_quote">On Wed, Feb 10, 2010 at 7:16 PM, Alan W. Irwin <span dir="ltr"><<a href="mailto:irwin@beluga.phys.uvic.ca">irwin@beluga.phys.uvic.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 2010-02-10 23:41+0100 Gabriel Petrovay wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
We are using CMake 2.6. For Windows we need the DLL's of the required<br>
libraries for two reasons given below.<br>
<br>
Take for example LibXml.dll which is required by our project in order to run<br>
on Windows. One can build and link our project successfully because the<br>
FindLibXml2.cmake provides:<br>
# LIBXML2_INCLUDE_DIR - The LibXml2 include directory<br>
# LIBXML2_LIBRARIES - The libraries needed to use LibXml2<br>
<br>
But we also need a reference to the LibXml2.dll file for the following 2<br>
reasons.<br>
<br>
1. When you "make" the "install" target (e.g. "nmake install"), the dll of<br>
the required library has to go into the "bin" directory, as well where our<br>
executable.<br>
2. We also need to set the PATH environment variable in order to execute our<br>
own executable (during the build, a bootstrap executable). So we need it in<br>
a scenario like:<br>
SET(ENV{PATH} ${LIBXML2_DLL})<br>
</blockquote>
<br></div>
Would setting that environment variable from cmake affect subsequent Windows<br>
builds? I don't have any Windows development experience, but this question<br>
just came up on the PLplot list. There, we all speculated from our various<br>
Linux and Windows platform perspectives that SET(ENV{PATH} ...) just sets<br>
the PATH when you are running cmake and would have no effect on the<br>
environment for the subsequent build. Thus, we thought you would have to<br>
externally set the PATH before running the build. But we all could be wrong<br>
which is why I have asked this question. :-)<br>
<br></blockquote><div><br></div><div>Alan,</div><div><br></div><div>You are correct. Doing this...</div><div><br></div><div>SET(ENV{xxx} "value")</div><div><br></div><div>...in a CMakeLists.txt file only sets an environment variable for the duration of the cmake run. It has no influence on downstream build steps.</div>
<div><br></div><div>HTH,</div><div>David</div><div><br></div></div>