From 2db99f34d1fbfecf32c485239755ecfdfab6cee5 Mon Sep 17 00:00:00 2001 From: Matt Reynolds Date: Sat, 11 Jan 2020 15:18:02 -0500 Subject: [PATCH] Re-install test plugin libraries --- combined_robot_hw_tests/CMakeLists.txt | 23 ++++++++++++++++++----- controller_manager_tests/CMakeLists.txt | 23 ++++++++++++++++++----- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/combined_robot_hw_tests/CMakeLists.txt b/combined_robot_hw_tests/CMakeLists.txt index d7ec445a3..46402d29c 100644 --- a/combined_robot_hw_tests/CMakeLists.txt +++ b/combined_robot_hw_tests/CMakeLists.txt @@ -26,7 +26,7 @@ if(CATKIN_ENABLE_TESTING) # Specify header include paths include_directories(include ${catkin_INCLUDE_DIRS}) - add_library(${PROJECT_NAME} EXCLUDE_FROM_ALL + add_library(${PROJECT_NAME} src/my_robot_hw_1.cpp src/my_robot_hw_2.cpp src/my_robot_hw_3.cpp @@ -57,7 +57,20 @@ endif() ## Install ## ############# -# Install plugins -install(FILES test_robot_hw_plugin.xml - DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} -) +# NOTE: Libraries and plugins required for tests are installed since CI +# runs tests out of the install space rather than the devel space + +if(CATKIN_ENABLE_TESTING) + + # Install targets + install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} + ) + + # Install plugins + install(FILES test_robot_hw_plugin.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} + ) +endif() diff --git a/controller_manager_tests/CMakeLists.txt b/controller_manager_tests/CMakeLists.txt index b15e56164..036aafc71 100644 --- a/controller_manager_tests/CMakeLists.txt +++ b/controller_manager_tests/CMakeLists.txt @@ -25,7 +25,7 @@ if(CATKIN_ENABLE_TESTING) # Specify header include paths include_directories(include ${catkin_INCLUDE_DIRS}) - add_library(${PROJECT_NAME} EXCLUDE_FROM_ALL + add_library(${PROJECT_NAME} src/effort_test_controller.cpp src/extensible_controllers.cpp src/my_dummy_controller.cpp @@ -56,7 +56,20 @@ endif() ## Install ## ############# -# Install plugins -install(FILES test_controllers_plugin.xml - DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} -) +# NOTE: Libraries and plugins required for tests are installed since CI +# runs tests out of the install space rather than the devel space + +if(CATKIN_ENABLE_TESTING) + + # Install targets + install(TARGETS ${PROJECT_NAME} + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} + ) + + # Install plugins + install(FILES test_controllers_plugin.xml + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} + ) +endif()