Skip to content

Commit a183b76

Browse files
kejxujohnsonshih
authored andcommitted
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 7c2cd4a. 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 <[email protected]>
1 parent 6b1825c commit a183b76

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,21 @@ include_directories(${catkin_INCLUDE_DIRS})
77

88
add_library(${PROJECT_NAME}_TestPlugins1 EXCLUDE_FROM_ALL plugins1.cpp)
99
target_link_libraries(${PROJECT_NAME}_TestPlugins1 ${PROJECT_NAME})
10+
if(WIN32)
11+
# On Windows, default library runtime output set to CATKIN_GLOBAL_BIN_DESTINATION,
12+
# change it back to CATKIN_PACKAGE_BIN_DESTINATION so the test can run correctly
13+
set_target_properties(${PROJECT_NAME}_TestPlugins1 PROPERTIES
14+
RUNTIME_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION})
15+
endif()
1016
class_loader_hide_library_symbols(${PROJECT_NAME}_TestPlugins1)
1117
add_library(${PROJECT_NAME}_TestPlugins2 EXCLUDE_FROM_ALL plugins2.cpp)
1218
target_link_libraries(${PROJECT_NAME}_TestPlugins2 ${PROJECT_NAME})
19+
if(WIN32)
20+
# On Windows, default library runtime output set to CATKIN_GLOBAL_BIN_DESTINATION,
21+
# change it back to CATKIN_PACKAGE_BIN_DESTINATION so the test can run correctly
22+
set_target_properties(${PROJECT_NAME}_TestPlugins2 PROPERTIES
23+
RUNTIME_OUTPUT_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_BIN_DESTINATION})
24+
endif()
1325
class_loader_hide_library_symbols(${PROJECT_NAME}_TestPlugins2)
1426

1527
catkin_add_gtest(${PROJECT_NAME}_utest utest.cpp)

0 commit comments

Comments
 (0)