On Tue, Dec 16, 2008 at 3:58 PM, Brad Aisa <span dir="ltr">&lt;<a href="mailto:Brad.Aisa@colorado.edu">Brad.Aisa@colorado.edu</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
From: &quot;Ladanyi, Akos&quot; &lt;<a href="mailto:ladanyi@tmit.bme.hu" target="_blank">ladanyi@tmit.bme.hu</a>&gt;<br>
Subject: [CMake] running executables linked to a dll in the build<br>
 &nbsp; &nbsp; &nbsp; &nbsp;directory<div class="Ih2E3d"><br>
<br>
My source tree consists of a library, and some test programs for the<br>
library. The library is built as a dll, and the test programs link<br>
against the import library of this dll. When I try to run the test<br>
programs (in the build tree), they fail, because they can not find the<br>
dll. What is the proper way of solving this with CMake?<br>
<br>
The only solution I found in the archives is setting<br>
RUNTIME_OUTPUT_DIRECTORY so that the dll and the executables end up in<br>
the same folder. Is there a better way?<br>
</div></blockquote>
<br>
YIKES! Some of those other answers were very complicated. Your suggestion is the best approach -- Windows automatically looks in the current folder for dlls (unlike Unix which has no default), so this is by far the easiest way.<br>

&nbsp;See also the CMAKE_RUNTIME_OUTPUT_DIRECTORY (I think that is what it is called) that you can set once, which then sets the RUNTIME_... automatically for your targets.</blockquote><div><br>I agree that&#39;s the best option.<br>
<br>One other option (hardly worth mentioning) might be to run your test binaries within CTest and use the latest support in CMake CVS for setting environment variables for tests (i.e. set PATH to be &quot;$ENV{PATH};${CMAKE_RUNTIME_OUTPUT_DIRECTORY}&quot; ).<br>
<br><a href="http://cmake.org/Bug/view.php?id=7885">http://cmake.org/Bug/view.php?id=7885</a><br><br></div></div><br>-- <br>Philip Lowman<br>