Skip to content

Commit 5dc0dda

Browse files
authored
Update the package template for our new include directories. (#847)
That is, add the additional PROJECT_NAME into the include path, like we've done since Humble. Signed-off-by: Chris Lalancette <[email protected]>
1 parent 4523cc5 commit 5dc0dda

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ros2pkg/ros2pkg/resource/ament_cmake/CMakeLists.txt.em

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ add_library(@(project_name)::@(cpp_library_name) ALIAS @(cpp_library_name))
2626
target_compile_features(@(cpp_library_name) PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
2727
target_include_directories(@(cpp_library_name) PUBLIC
2828
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
29-
$<INSTALL_INTERFACE:include>)
29+
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>)
3030
@[ if dependencies]@
3131
ament_target_dependencies(
3232
@(cpp_library_name)
@@ -42,7 +42,7 @@ target_compile_definitions(@(cpp_library_name) PRIVATE "@(project_name.upper())_
4242

4343
install(
4444
DIRECTORY include/
45-
DESTINATION include
45+
DESTINATION include/${PROJECT_NAME}
4646
)
4747
install(
4848
TARGETS @(cpp_library_name)
@@ -57,7 +57,7 @@ install(
5757
add_executable(@(cpp_node_name) src/@(cpp_node_name).cpp)
5858
target_include_directories(@(cpp_node_name) PUBLIC
5959
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
60-
$<INSTALL_INTERFACE:include>)
60+
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>)
6161
@[ if cpp_library_name]@
6262
target_link_libraries(@(cpp_node_name) @(cpp_library_name))
6363
@[ else]@
@@ -90,7 +90,7 @@ endif()
9090
@[if cpp_library_name]@
9191

9292
ament_export_include_directories(
93-
include
93+
"include/${PROJECT_NAME}"
9494
)
9595
ament_export_libraries(
9696
@(cpp_library_name)

0 commit comments

Comments
 (0)