From c887ce04928b63aa1dfeb7b8e8d161706bc19e40 Mon Sep 17 00:00:00 2001 From: Yuki Onishi Date: Thu, 2 May 2024 02:32:16 +0900 Subject: [PATCH] Fix installation conditions of 'launch' files with catkin --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 453fab5..19bd17b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,10 +56,14 @@ if(DEFINED ENV{ROS_VERSION}) # For ros_control install(FILES plugins.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) - install(DIRECTORY launch - DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} - USE_SOURCE_PERMISSIONS - ) + # Install `launch` dir. only if `--install` option is set in catkin config + if(${CMAKE_INSTALL_PREFIX} MATCHES .*/install) + install(DIRECTORY launch + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} + USE_SOURCE_PERMISSIONS + PATTERN "ros2" EXCLUDE + ) + endif() elseif($ENV{ROS_VERSION} EQUAL 2) ament_package()