From 810d01c4a4e617366ac7ff563224673ebb063ae6 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Thu, 3 Feb 2022 15:10:19 -0800 Subject: [PATCH] Install headers to include/${PROJECT_NAME} (#86) Signed-off-by: Shane Loretz --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17dbf6a..8089906 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ add_library(laser_geometry SHARED src/laser_geometry.cpp) target_include_directories(laser_geometry PUBLIC $ - $ + $ ${Eigen3_INCLUDE_DIRS} ) ament_target_dependencies(laser_geometry @@ -33,9 +33,13 @@ ament_target_dependencies(laser_geometry # which is appropriate when building the dll but not consuming it. target_compile_definitions(laser_geometry PRIVATE "LASER_GEOMETRY_BUILDING_LIBRARY") -ament_export_include_directories(include) +# Export old-style CMake variables +ament_export_include_directories("include/${PROJECT_NAME}") ament_export_libraries(laser_geometry) + +# Export modern CMake targets ament_export_targets(laser_geometry) + ament_export_dependencies( eigen3_cmake_module Eigen3 @@ -55,7 +59,7 @@ install( install( DIRECTORY include/ - DESTINATION include + DESTINATION include/${PROJECT_NAME} ) if(BUILD_TESTING)