From 17de6fe51b75922058e10fdbec4033fee2c88cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 6 Aug 2013 21:46:39 +0200 Subject: [PATCH] Install also test libs on Windows. Resolves DLL hell when running tests. --- src/CMakeLists.txt | 6 ++++++ src/MeshTools/CMakeLists.txt | 6 ++++++ src/SceneGraph/CMakeLists.txt | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bb6c8fb12..ae045b56e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -236,5 +236,11 @@ if(BUILD_TESTS) set_target_properties(MagnumTestLib PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT) target_link_libraries(MagnumTestLib ${Magnum_LIBS}) + # On Windows we need to install first and then run the tests to avoid "DLL + # not found" hell, thus we need to install this too + if(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS MagnumMathTestLib MagnumTestLib DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + endif() + add_subdirectory(Test) endif() diff --git a/src/MeshTools/CMakeLists.txt b/src/MeshTools/CMakeLists.txt index ef0c26d2e..6e9762e58 100644 --- a/src/MeshTools/CMakeLists.txt +++ b/src/MeshTools/CMakeLists.txt @@ -77,5 +77,11 @@ if(BUILD_TESTS) set_target_properties(MagnumMeshToolsTestLib PROPERTIES COMPILE_FLAGS "-DCORRADE_GRACEFUL_ASSERT -DMagnumMeshTools_EXPORTS") target_link_libraries(MagnumMeshToolsTestLib Magnum) + # On Windows we need to install first and then run the tests to avoid "DLL + # not found" hell, thus we need to install this too + if(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS MagnumMeshToolsTestLib DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + endif() + add_subdirectory(Test) endif() diff --git a/src/SceneGraph/CMakeLists.txt b/src/SceneGraph/CMakeLists.txt index e4f7d6145..8238973a5 100644 --- a/src/SceneGraph/CMakeLists.txt +++ b/src/SceneGraph/CMakeLists.txt @@ -92,5 +92,11 @@ if(BUILD_TESTS) set_target_properties(MagnumSceneGraphTestLib PROPERTIES COMPILE_FLAGS "-DCORRADE_GRACEFUL_ASSERT -DMagnumSceneGraph_EXPORTS") target_link_libraries(MagnumSceneGraphTestLib MagnumMathTestLib) + # On Windows we need to install first and then run the tests to avoid "DLL + # not found" hell, thus we need to install this too + if(WIN32 AND NOT CMAKE_CROSSCOMPILING) + install(TARGETS MagnumSceneGraphTestLib DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + endif() + add_subdirectory(Test) endif()