From 5228e9ba9518fae12800185e4bda8a26c6f3160a Mon Sep 17 00:00:00 2001 From: Krzysztof Lis Date: Wed, 7 Sep 2016 17:58:39 +0200 Subject: [PATCH] CMake install rules Added rules to copy files necessary for running the module with "make install". --- bebop_description/CMakeLists.txt | 16 +++++++++++- bebop_driver/CMakeLists.txt | 45 +++++++++++++++++++------------- bebop_tools/CMakeLists.txt | 15 ++++++++++- 3 files changed, 56 insertions(+), 20 deletions(-) diff --git a/bebop_description/CMakeLists.txt b/bebop_description/CMakeLists.txt index 2ad33ee..0845b73 100644 --- a/bebop_description/CMakeLists.txt +++ b/bebop_description/CMakeLists.txt @@ -8,4 +8,18 @@ find_package(catkin REQUIRED COMPONENTS catkin_package() # TODO: Tests -# TODO: Install Rules + +############# +## Install ## +############# + +# Copy launch files +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + FILES_MATCHING PATTERN "*.launch" +) + +# Copy resources +install(DIRECTORY urdf/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/urdf +) diff --git a/bebop_driver/CMakeLists.txt b/bebop_driver/CMakeLists.txt index ebd30f6..bed38bf 100644 --- a/bebop_driver/CMakeLists.txt +++ b/bebop_driver/CMakeLists.txt @@ -113,26 +113,35 @@ target_link_libraries(bebop_driver_node # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} # ) -## Mark executables and/or libraries for installation -# install(TARGETS bebop_autonomy bebop_autonomy_node -# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} -# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) +# Mark executables and/or libraries for installation +install(TARGETS bebop bebop_driver_node bebop_driver_nodelet + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}/ + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}/ + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}/ +) -## Mark cpp header files for installation -# install(DIRECTORY include/${PROJECT_NAME}/ -# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} -# FILES_MATCHING PATTERN "*.h" -# PATTERN ".svn" EXCLUDE -# ) +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} + FILES_MATCHING PATTERN "*.h" +) -## Mark other files for installation (e.g. launch and bag files, etc.) -# install(FILES -# # myfile1 -# # myfile2 -# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} -# ) +# Copy config files +install(DIRECTORY config/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config +) + +install(DIRECTORY data/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/data +) + +install(FILES nodelet_plugins.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) + +# Copy launch files +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + FILES_MATCHING PATTERN "*.launch" +) ############# ## Testing ## diff --git a/bebop_tools/CMakeLists.txt b/bebop_tools/CMakeLists.txt index 6341b46..a02a924 100644 --- a/bebop_tools/CMakeLists.txt +++ b/bebop_tools/CMakeLists.txt @@ -12,4 +12,17 @@ catkin_package( CATKIN_DEPENDS bebop_msgs ) -# TODO: Install Rules +############# +## Install ## +############# + +# Copy launch files +install(DIRECTORY launch/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch + FILES_MATCHING PATTERN "*.launch" +) + +# Copy config files +install(DIRECTORY config/ + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config +)