Skip to content

Commit

Permalink
Install headers to include/${PROJECT_NAME} (#578)
Browse files Browse the repository at this point in the history
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
  • Loading branch information
sloretz authored Feb 10, 2022
1 parent e7c749a commit 33c54b0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
7 changes: 4 additions & 3 deletions rmw_fastrtps_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ configure_rmw_library(rmw_fastrtps_cpp)
target_compile_definitions(${PROJECT_NAME}
PRIVATE "RMW_FASTRTPS_CPP_BUILDING_LIBRARY")

# specific order: dependents before dependencies
ament_export_include_directories(include)
# Export old-style CMake variables
ament_export_include_directories("include/${PROJECT_NAME}")
ament_export_libraries(rmw_fastrtps_cpp)

# specific order: dependents before dependencies
ament_export_dependencies(rcutils)
ament_export_dependencies(rmw)
ament_export_dependencies(rmw_dds_common)
Expand Down Expand Up @@ -159,7 +160,7 @@ ament_package(

install(
DIRECTORY include/
DESTINATION include
DESTINATION include/${PROJECT_NAME}
)

install(
Expand Down
7 changes: 4 additions & 3 deletions rmw_fastrtps_dynamic_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ configure_rmw_library(rmw_fastrtps_dynamic_cpp)
target_compile_definitions(${PROJECT_NAME}
PRIVATE "RMW_FASTRTPS_DYNAMIC_CPP_BUILDING_LIBRARY")

# specific order: dependents before dependencies
ament_export_include_directories(include)
# Export old-style CMake variables
ament_export_include_directories("include/${PROJECT_NAME}")
ament_export_libraries(rmw_fastrtps_dynamic_cpp)

# specific order: dependents before dependencies
ament_export_dependencies(rcpputils)
ament_export_dependencies(rcutils)
ament_export_dependencies(rmw)
Expand Down Expand Up @@ -169,7 +170,7 @@ ament_package(

install(
DIRECTORY include/
DESTINATION include
DESTINATION include/${PROJECT_NAME}
)

install(
Expand Down
11 changes: 7 additions & 4 deletions rmw_fastrtps_shared_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ add_library(rmw_fastrtps_shared_cpp
target_include_directories(rmw_fastrtps_shared_cpp
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
target_link_libraries(rmw_fastrtps_shared_cpp
fastcdr fastrtps
)
Expand All @@ -111,11 +111,14 @@ ament_target_dependencies(rmw_fastrtps_shared_cpp
target_compile_definitions(${PROJECT_NAME}
PRIVATE "RMW_FASTRTPS_SHARED_CPP_BUILDING_LIBRARY")

# specific order: dependents before dependencies
ament_export_include_directories(include)
# Export old-style CMake variables
ament_export_include_directories("include/${PROJECT_NAME}")
ament_export_libraries(rmw_fastrtps_shared_cpp)

# Export modern CMake targets
ament_export_targets(rmw_fastrtps_shared_cpp)

# specific order: dependents before dependencies
ament_export_dependencies(rcpputils)
ament_export_dependencies(rcutils)
ament_export_dependencies(rmw)
Expand All @@ -133,7 +136,7 @@ ament_package(

install(
DIRECTORY include/
DESTINATION include
DESTINATION include/${PROJECT_NAME}
)

install(
Expand Down

0 comments on commit 33c54b0

Please sign in to comment.