<div class="gmail_quote">On Thu, Feb 10, 2011 at 7:54 AM, Xavier Decoret <span dir="ltr"><<a href="mailto:x.decoret@me.com">x.decoret@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I am trying to run test on Windows (using the NMake generator and Visual Studio) and encounter several problems:<br>
<br>
First 'nmake test' does not run the tests, as it does on other platforms (Unix w/ make generators).<br>
<br>
Then, when I manually run ctest from the PROJECT_BINARY_DIR, the test will fail because the dependent libraries (dynamic libraries generated by the target) are not in the path.<br>
<br>
On Unix platform, I do not have the issue: the rpath is set correctly when I use the target_link_libraries().<br>
<br>
What should I do on Windows? The only solution I see for the moment is to 'nmake install' the tests and run fixup_bundle() on them. Another solution is to manually maintain the list of path of DLLs and try to pass it to CTest. But I cannot find a way to do that from cmake. Besides, those DLLs are scattered around the build tree. Another solution would be to force all libraries and binaries in a single directory using the RUNTIME_OUTPUT_DIRECTORY variable.<br>
<br>
What would you recommend?<br></blockquote><div><br>Putting all the dlls and exes into a single directory is the easiest thing to do if you don't mind reorganizing your build tree...<br><br>If you must keep your build tree, another strategy would be to run all your tests through a script that drives the test rather than calling the executable directly. Then, in that script, you could set the PATH env var to include all the directories where all the dlls are located.<br>
<br><br>HTH,<br>David<br><br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
PS: It is pretty common to generate a library that is linked with a main executable, and linked with a test executable. I am pretty sure this is handled by cmake/ctest.<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <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: <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>
</blockquote></div><br>