Skip to content

Commit

Permalink
ros2: use recommended ament install destinations
Browse files Browse the repository at this point in the history
Signed-off-by: Rhys Mainwaring <[email protected]>
  • Loading branch information
srmainwaring committed Nov 15, 2023
1 parent bc14f10 commit 94e0018
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 30 deletions.
12 changes: 6 additions & 6 deletions terrain_navigation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ target_include_directories(${PROJECT_NAME}
"$<INSTALL_INTERFACE:include/${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
)
Expand All @@ -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)
Expand Down
18 changes: 7 additions & 11 deletions terrain_navigation_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ target_include_directories(${PROJECT_NAME}
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)

target_link_libraries(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME} PUBLIC
${Boost_LIBRARIES}
${GeographicLib_LIBRARIES}
${OMPL_LIBRARIES}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -116,19 +114,17 @@ 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)

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
Expand Down
21 changes: 8 additions & 13 deletions terrain_planner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -62,15 +59,15 @@ 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}
${tf2_geometry_msgs_TARGETS}
tf2_eigen::tf2_eigen
)

ament_target_dependencies(${PROJECT_NAME} SYSTEM
ament_target_dependencies(${PROJECT_NAME} PUBLIC
grid_map_core
grid_map_geo
terrain_navigation
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 94e0018

Please sign in to comment.