From 776df762e50b2d17757d0a42c1c07f6c173418c2 Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Wed, 8 Nov 2023 11:28:01 +0000 Subject: [PATCH] ros2: use recommended ament install destinations Signed-off-by: Rhys Mainwaring --- terrain_navigation/CMakeLists.txt | 12 ++++++------ terrain_navigation_ros/CMakeLists.txt | 18 +++++++----------- terrain_planner/CMakeLists.txt | 21 ++++++++------------- 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/terrain_navigation/CMakeLists.txt b/terrain_navigation/CMakeLists.txt index a3d8e48b..7f196396 100644 --- a/terrain_navigation/CMakeLists.txt +++ b/terrain_navigation/CMakeLists.txt @@ -57,13 +57,13 @@ target_include_directories(${PROJECT_NAME} "$" ) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen GDAL::GDAL ${OpenCV_LIBRARIES} ) -ament_target_dependencies(${PROJECT_NAME} SYSTEM +ament_target_dependencies(${PROJECT_NAME} PUBLIC grid_map_core grid_map_geo ) @@ -78,13 +78,13 @@ install( TARGETS ${PROJECT_NAME} EXPORT export_${PROJECT_NAME} - ARCHIVE DESTINATION lib/${PROJECT_NAME} - LIBRARY DESTINATION lib/${PROJECT_NAME} - RUNTIME DESTINATION bin/${PROJECT_NAME} + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin ) ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET) -# ament_export_dependencies(GDAL) +ament_export_dependencies(GDAL) # Test if(BUILD_TESTING) diff --git a/terrain_navigation_ros/CMakeLists.txt b/terrain_navigation_ros/CMakeLists.txt index ea56b7a4..a7eeda58 100644 --- a/terrain_navigation_ros/CMakeLists.txt +++ b/terrain_navigation_ros/CMakeLists.txt @@ -65,7 +65,7 @@ target_include_directories(${PROJECT_NAME} "$" ) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PUBLIC ${Boost_LIBRARIES} ${GeographicLib_LIBRARIES} ${OMPL_LIBRARIES} @@ -83,7 +83,7 @@ target_link_libraries(${PROJECT_NAME} ${visualization_msgs_TARGETS} ) -ament_target_dependencies(${PROJECT_NAME} SYSTEM +ament_target_dependencies(${PROJECT_NAME} PUBLIC grid_map_core grid_map_ros terrain_navigation @@ -94,11 +94,9 @@ add_executable(terrain_planner_node src/terrain_planner_node.cpp ) -target_link_libraries(terrain_planner_node +target_link_libraries(terrain_planner_node PUBLIC ${PROJECT_NAME} - # ${GDAL_LIBRARY} ${ODE_LIBRARIES} - # ${OpenCV_LIBRARIES} ) target_link_directories(terrain_planner_node PUBLIC @@ -116,9 +114,9 @@ install( TARGETS ${PROJECT_NAME} EXPORT export_${PROJECT_NAME} - ARCHIVE DESTINATION lib/${PROJECT_NAME} - LIBRARY DESTINATION lib/${PROJECT_NAME} - RUNTIME DESTINATION bin/${PROJECT_NAME} + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin ) ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET) @@ -126,9 +124,7 @@ ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET) install( TARGETS terrain_planner_node - ARCHIVE DESTINATION lib/${PROJECT_NAME} - LIBRARY DESTINATION lib/${PROJECT_NAME} - RUNTIME DESTINATION lib/${PROJECT_NAME} + DESTINATION lib/${PROJECT_NAME} ) install(DIRECTORY diff --git a/terrain_planner/CMakeLists.txt b/terrain_planner/CMakeLists.txt index 1eb59ffa..47dc287d 100644 --- a/terrain_planner/CMakeLists.txt +++ b/terrain_planner/CMakeLists.txt @@ -40,9 +40,6 @@ find_package(ompl REQUIRED) find_package(PkgConfig REQUIRED) pkg_check_modules(ODE REQUIRED ode) -# message("ODE_FOUND: ${ODE_FOUND}") -# message("ODE_LIBRARIES: ${ODE_LIBRARIES}") -# message("ODE_LIBRARY_DIRS: ${ODE_LIBRARY_DIRS}") # Libraries add_library(${PROJECT_NAME} @@ -62,7 +59,7 @@ target_include_directories(${PROJECT_NAME} ${OMPL_INCLUDE_DIR} ) -target_link_libraries(${PROJECT_NAME} +target_link_libraries(${PROJECT_NAME} PUBLIC ${Boost_LIBRARIES} ${OMPL_LIBRARIES} ${OpenCV_LIBRARIES} @@ -70,7 +67,7 @@ target_link_libraries(${PROJECT_NAME} tf2_eigen::tf2_eigen ) -ament_target_dependencies(${PROJECT_NAME} SYSTEM +ament_target_dependencies(${PROJECT_NAME} PUBLIC grid_map_core grid_map_geo terrain_navigation @@ -113,7 +110,7 @@ target_link_directories(test_ompl_dubins PUBLIC ${yaml_cpp_vendor_LIBRARY_DIRS} ) -target_link_libraries(test_ompl_dubins +target_link_libraries(test_ompl_dubins PUBLIC ${PROJECT_NAME} ${OpenCV_LIBRARIES} ${ODE_LIBRARIES} @@ -136,7 +133,7 @@ target_link_directories(test_ompl_dubins_to_circle PUBLIC ${yaml_cpp_vendor_LIBRARY_DIRS} ) -target_link_libraries(test_ompl_dubins_to_circle +target_link_libraries(test_ompl_dubins_to_circle PUBLIC ${PROJECT_NAME} ${OpenCV_LIBRARIES} ${ODE_LIBRARIES} @@ -156,9 +153,9 @@ install( TARGETS ${PROJECT_NAME} EXPORT export_${PROJECT_NAME} - ARCHIVE DESTINATION lib/${PROJECT_NAME} - LIBRARY DESTINATION lib/${PROJECT_NAME} - RUNTIME DESTINATION bin/${PROJECT_NAME} + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin ) ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET) @@ -168,9 +165,7 @@ install( test_rrt_node test_ompl_dubins test_ompl_dubins_to_circle - ARCHIVE DESTINATION lib/${PROJECT_NAME} - LIBRARY DESTINATION lib/${PROJECT_NAME} - RUNTIME DESTINATION lib/${PROJECT_NAME} + DESTINATION lib/${PROJECT_NAME} ) install(DIRECTORY