Hi Nils,

It isn't as bad as I might have made it sound. e.g.:

add_executable(mytest test.cpp)
set_target_properties(mytest PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR})
add_test(mytest ${CMAKE_BINARY_DIR}/mytest)

Yes. Everything works OK now. My question was more of a theoretical interest...

On unix (I'm not sure about all but at least on gnu linux) CMake
"tweaks" by embedding library paths into executables (RPATH) which
allows the OS to use those paths at runtime.
As far as I know there is no equivalent feature on windows(?)

The reason why I expected it to "just work" under MSVC is that when working with MSVC without CMake, creating a dependency in test on the library makes test automatically load the library even though it is not on the system path. I have no idea how it works, I would expect MSVC IDE simply to add relevant library to the path when running the test.

Anyway, with CMake-generated solution this doesn't seem to work. The dependency is generated as expected, however, when trying to run the test MSVC is unable to find the library.

Martin
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to