Install headers to include/${PROJECT_NAME} (#86)

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
This commit is contained in:
Shane Loretz 2022-02-03 15:10:19 -08:00 committed by GitHub
parent a6a18f8e7e
commit 810d01c4a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ add_library(laser_geometry SHARED src/laser_geometry.cpp)
target_include_directories(laser_geometry target_include_directories(laser_geometry
PUBLIC PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include/${PROJECT_NAME}>
${Eigen3_INCLUDE_DIRS} ${Eigen3_INCLUDE_DIRS}
) )
ament_target_dependencies(laser_geometry 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. # which is appropriate when building the dll but not consuming it.
target_compile_definitions(laser_geometry PRIVATE "LASER_GEOMETRY_BUILDING_LIBRARY") 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) ament_export_libraries(laser_geometry)
# Export modern CMake targets
ament_export_targets(laser_geometry) ament_export_targets(laser_geometry)
ament_export_dependencies( ament_export_dependencies(
eigen3_cmake_module eigen3_cmake_module
Eigen3 Eigen3
@ -55,7 +59,7 @@ install(
install( install(
DIRECTORY include/ DIRECTORY include/
DESTINATION include DESTINATION include/${PROJECT_NAME}
) )
if(BUILD_TESTING) if(BUILD_TESTING)