From a183b762a81c91647c3828823b33d64fed1b6e45 Mon Sep 17 00:00:00 2001 From: James Xu Date: Fri, 29 Mar 2019 13:33:44 -0700 Subject: [PATCH] set test dll runtime output to CATKIN_PACKAGE_BIN_DESTINATION on Windows (#113) * set the test dll runtime output to lib Set the test dll runtime output to CATKIN_PACKAGE_BIN_DESTINATION to match default Revert "Set the test dll runtime output to CATKIN_PACKAGE_BIN_DESTINATION to match default" This reverts commit 7c2cd4af23c6009d311d3f01937c9ffea92a3b39. set the test dll runtime output to lib * Set the test dll runtime output to CATKIN_PACKAGE_BIN_DESTINATION to match default Co-authored-by: Johnson Shih --- test/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 15bbb334..bd64a8fc 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,9 +7,21 @@ include_directories(${catkin_INCLUDE_DIRS}) add_library(${PROJECT_NAME}_TestPlugins1 EXCLUDE_FROM_ALL plugins1.cpp) target_link_libraries(${PROJECT_NAME}_TestPlugins1 ${PROJECT_NAME}) +if(WIN32) + # On Windows, default library runtime output set to CATKIN_GLOBAL_BIN_DESTINATION, + # change it back to CATKIN_PACKAGE_BIN_DESTINATION so the test can run correctly + set_target_properties(${PROJECT_NAME}_TestPlugins1 PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION}) +endif() class_loader_hide_library_symbols(${PROJECT_NAME}_TestPlugins1) add_library(${PROJECT_NAME}_TestPlugins2 EXCLUDE_FROM_ALL plugins2.cpp) target_link_libraries(${PROJECT_NAME}_TestPlugins2 ${PROJECT_NAME}) +if(WIN32) + # On Windows, default library runtime output set to CATKIN_GLOBAL_BIN_DESTINATION, + # change it back to CATKIN_PACKAGE_BIN_DESTINATION so the test can run correctly + set_target_properties(${PROJECT_NAME}_TestPlugins2 PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION}) +endif() class_loader_hide_library_symbols(${PROJECT_NAME}_TestPlugins2) catkin_add_gtest(${PROJECT_NAME}_utest utest.cpp)