All,

I currently have a test program that is used to test an API in shared library that I am producing as part of the build. The build of the shared library and running of the test program is working on Linux but not on Windows because it appears to me that my test program cannot find the DLL for the library it is testing.

My directory structure looks like:

  util/
     build/
        lib/
     include/
     src/
     test/

==== util/CMakeLists.txt ====
set(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/lib")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")

file(GLOB header_files "include/*.hpp")
file(GLOB src_files "include/*.hpp")

add_library(util ${header_files} ${src_files})
target_link_libraries(util log4cplus)

add_subdirectory(test)

==== util/test/CMakeLists.txt ====
link_directories("${LIBRARY_OUTPUT_PATH}")

add_executable(my_test my_test.cpp)
target_link_libraries(util log4cplus)

add_test(my_test my_test)


As I said, on Linux when I do "make test", my_test gets run fine--I think because rpath is properly recording the location of the shared libraries. On windows (Visual Studio 2005), my_test will not run. When I execute ctest by hand, I am told that it cannot locate 'util.dll' (as well as icuuc.dll, etc.)

Forgive me if there is a simple answer to this...Windows is a strange and foreign land to me.

Thanks,
-scott

_______________________________________________
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