Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install generated headers to include/${PROJECT_NAME} #670

Merged
merged 1 commit into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ set_property(TARGET ${rosidl_generate_interfaces_TARGET}${_target_suffix}
target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_c>"
"$<INSTALL_INTERFACE:include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES})
# Depend on targets generated by this generator in dependency packages
Expand All @@ -146,12 +146,12 @@ add_dependencies(
if(NOT rosidl_generate_interfaces_SKIP_INSTALL)
install(
DIRECTORY ${_output_path}/
DESTINATION "include/${PROJECT_NAME}"
DESTINATION "include/${PROJECT_NAME}/${PROJECT_NAME}"
PATTERN "*.h"
)

# Export old-style CMake variables
ament_export_include_directories("include")
ament_export_include_directories("include/${PROJECT_NAME}")
ament_export_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix})

# Export modern CMake targets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ add_library(${rosidl_generate_interfaces_TARGET}${_target_suffix} INTERFACE)
target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix}
INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_cpp>"
"$<INSTALL_INTERFACE:include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES})
# Depend on targets generated by this generator in dependency packages
Expand Down Expand Up @@ -134,12 +134,12 @@ add_dependencies(
if(NOT rosidl_generate_interfaces_SKIP_INSTALL)
install(
DIRECTORY ${_output_path}/
DESTINATION "include/${PROJECT_NAME}"
DESTINATION "include/${PROJECT_NAME}/${PROJECT_NAME}"
PATTERN "*.hpp"
)

# Export old-style CMake variables
ament_export_include_directories("include")
ament_export_include_directories("include/${PROJECT_NAME}")

# Export modern CMake targets
ament_export_targets(export_${rosidl_generate_interfaces_TARGET}${_target_suffix})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ set_property(TARGET ${rosidl_generate_interfaces_TARGET}${_target_suffix}
target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/rosidl_typesupport_introspection_c>"
"$<INSTALL_INTERFACE:include>")
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")

# Depend on the library created by rosidl_generator_c
target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix} PUBLIC
Expand All @@ -138,7 +138,7 @@ add_dependencies(
if(NOT rosidl_generate_interfaces_SKIP_INSTALL)
install(
DIRECTORY ${_output_path}/
DESTINATION "include/${PROJECT_NAME}"
DESTINATION "include/${PROJECT_NAME}/${PROJECT_NAME}"
PATTERN "*.h"
)
install(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ endif()
target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/rosidl_typesupport_introspection_cpp>"
"$<INSTALL_INTERFACE:include>")
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")

# Depend on the library created by rosidl_generator_cpp
target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix} PUBLIC
Expand Down Expand Up @@ -136,7 +136,7 @@ add_dependencies(
if(NOT rosidl_generate_interfaces_SKIP_INSTALL)
install(
DIRECTORY ${_output_path}/
DESTINATION "include/${PROJECT_NAME}"
DESTINATION "include/${PROJECT_NAME}/${PROJECT_NAME}"
PATTERN "*.hpp"
)

Expand Down