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

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
This commit is contained in:
Shane Loretz 2022-02-03 10:11:55 -08:00 committed by GitHub
parent 755f566356
commit 8093d5b35d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 13 deletions

View File

@ -33,8 +33,8 @@ include_directories(
${PCL_COMMON_INCLUDE_DIRS} ${PCL_COMMON_INCLUDE_DIRS}
) )
install(DIRECTORY include/${PROJECT_NAME}/ install(DIRECTORY include/
DESTINATION include/${PROJECT_NAME}/ DESTINATION include/${PROJECT_NAME}
) )
# Add gtest based cpp test target # Add gtest based cpp test target
@ -48,6 +48,8 @@ if(BUILD_TESTING)
target_link_libraries(${PROJECT_NAME}-test ${Boost_LIBRARIES} ${PCL_LIBRARIES}) target_link_libraries(${PROJECT_NAME}-test ${Boost_LIBRARIES} ${PCL_LIBRARIES})
endif() endif()
ament_export_include_directories(include) # Export old-style CMake variables
ament_export_include_directories("include/${PROJECT_NAME}")
ament_export_dependencies(${dependencies}) ament_export_dependencies(${dependencies})
ament_package() ament_package()

View File

@ -34,17 +34,15 @@ set(dependencies
PCL PCL
) )
include_directories(
include
${PCL_INCLUDE_DIRS}
)
## Declare the pcl_ros_tf library ## Declare the pcl_ros_tf library
add_library(pcl_ros_tf src/transforms.cpp) add_library(pcl_ros_tf src/transforms.cpp)
target_include_directories(pcl_ros_tf PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
)
ament_target_dependencies(pcl_ros_tf ament_target_dependencies(pcl_ros_tf
${dependencies} ${dependencies}
) )
target_link_libraries(pcl_ros_tf ${PCL_LIBRARIES})
### Nodelets ### Nodelets
# #
@ -165,7 +163,7 @@ endif()
install( install(
DIRECTORY include/ DIRECTORY include/
DESTINATION include DESTINATION include/${PROJECT_NAME}
) )
install( install(
@ -185,14 +183,18 @@ install(
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
INCLUDES DESTINATION include
) )
install(DIRECTORY plugins samples install(DIRECTORY plugins samples
DESTINATION share/${PROJECT_NAME}) DESTINATION share/${PROJECT_NAME})
ament_export_include_directories(include) # Export old-style CMake variables
ament_export_include_directories("include/${PROJECT_NAME}")
ament_export_libraries(pcl_ros_tf) ament_export_libraries(pcl_ros_tf)
ament_export_dependencies(${dependencies})
# Export modern CMake targets
ament_export_targets(export_pcl_ros HAS_LIBRARY_TARGET) ament_export_targets(export_pcl_ros HAS_LIBRARY_TARGET)
ament_export_dependencies(${dependencies})
ament_package() ament_package()