[CMake] running executables linked to a dll in the build directory

Eric Noulard eric.noulard at gmail.com
Mon Dec 15 15:04:11 EST 2008


2008/12/15 Ladanyi, Akos <ladanyi at tmit.bme.hu>:
> Hi,
>
> My source tree consists of a library, and some test programs for the
> library. The library is built as a dll, and the test programs link
> against the import library of this dll. When I try to run the test
> programs (in the build tree), they fail, because they can not find the
> dll. What is the proper way of solving this with CMake?
>
> The only solution I found in the archives is setting
> RUNTIME_OUTPUT_DIRECTORY so that the dll and the executables end up in
> the same folder. Is there a better way?

On Linux it may be handled with RPATH setting
http://www.cmake.org/Wiki/CMake_RPATH_handling

On Windows I don't know.

However concerning the test program di you try CTest:
http://www.cmake.org/Wiki/CMake_Testing_With_CTest

I think when launching the test with CTest it should handle the
library location trouble
(I don't know how though)
-- 
Erk


More information about the CMake mailing list