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 authored and Jaeyoung-Lim committed Nov 8, 2023
1 parent 47cbef7 commit 19f59ae
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ target_include_directories(${PROJECT_NAME}
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)

target_link_libraries(${PROJECT_NAME} Eigen3::Eigen GDAL::GDAL)
target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen GDAL::GDAL)

ament_target_dependencies(${PROJECT_NAME} PUBLIC
grid_map_core
Expand All @@ -55,7 +55,7 @@ add_executable(test_tif_loader
src/test_tif_loader.cpp
)

target_link_libraries(test_tif_loader
target_link_libraries(test_tif_loader PUBLIC
${PROJECT_NAME}
)

Expand All @@ -69,26 +69,18 @@ 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)

# NOTE: if RUNTIME DESTINATION is set to bin/${PROJECT_NAME} the executable
# is not found by ros2 launch:
#
# Caught exception in launch (see debug for traceback): executable
# 'test_tif_loader' not found on the libexec directory
# '<ws_path>/ros2-aerial/install/grid_map_geo/lib/grid_map_geo'
install(
TARGETS
test_tif_loader
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 19f59ae

Please sign in to comment.