From 378111787a460b5f77841143e0e0463507617a5f Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Mon, 14 Mar 2022 17:36:49 -0700 Subject: [PATCH] Install generated headers to include/${PROJECT_NAME} Signed-off-by: Shane Loretz --- .../cmake/rosidl_generator_c_generate_interfaces.cmake | 6 +++--- .../cmake/rosidl_generator_cpp_generate_interfaces.cmake | 6 +++--- ...dl_typesupport_introspection_c_generate_interfaces.cmake | 4 ++-- ..._typesupport_introspection_cpp_generate_interfaces.cmake | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rosidl_generator_c/cmake/rosidl_generator_c_generate_interfaces.cmake b/rosidl_generator_c/cmake/rosidl_generator_c_generate_interfaces.cmake index a5276f17c..27d518b68 100644 --- a/rosidl_generator_c/cmake/rosidl_generator_c_generate_interfaces.cmake +++ b/rosidl_generator_c/cmake/rosidl_generator_c_generate_interfaces.cmake @@ -123,7 +123,7 @@ set_property(TARGET ${rosidl_generate_interfaces_TARGET}${_target_suffix} target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix} PUBLIC "$" - "$" + "$" ) foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES}) # Depend on targets generated by this generator in dependency packages @@ -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 diff --git a/rosidl_generator_cpp/cmake/rosidl_generator_cpp_generate_interfaces.cmake b/rosidl_generator_cpp/cmake/rosidl_generator_cpp_generate_interfaces.cmake index 4db4fc98b..7fe41a687 100644 --- a/rosidl_generator_cpp/cmake/rosidl_generator_cpp_generate_interfaces.cmake +++ b/rosidl_generator_cpp/cmake/rosidl_generator_cpp_generate_interfaces.cmake @@ -105,7 +105,7 @@ add_library(${rosidl_generate_interfaces_TARGET}${_target_suffix} INTERFACE) target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix} INTERFACE "$" - "$" + "$" ) foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES}) # Depend on targets generated by this generator in dependency packages @@ -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}) diff --git a/rosidl_typesupport_introspection_c/cmake/rosidl_typesupport_introspection_c_generate_interfaces.cmake b/rosidl_typesupport_introspection_c/cmake/rosidl_typesupport_introspection_c_generate_interfaces.cmake index 326d9ca79..b8f7b3d1d 100644 --- a/rosidl_typesupport_introspection_c/cmake/rosidl_typesupport_introspection_c_generate_interfaces.cmake +++ b/rosidl_typesupport_introspection_c/cmake/rosidl_typesupport_introspection_c_generate_interfaces.cmake @@ -114,7 +114,7 @@ set_property(TARGET ${rosidl_generate_interfaces_TARGET}${_target_suffix} target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix} PUBLIC "$" - "$") + "$") # Depend on the library created by rosidl_generator_c target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix} PUBLIC @@ -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( diff --git a/rosidl_typesupport_introspection_cpp/cmake/rosidl_typesupport_introspection_cpp_generate_interfaces.cmake b/rosidl_typesupport_introspection_cpp/cmake/rosidl_typesupport_introspection_cpp_generate_interfaces.cmake index 342073463..caaa64c65 100644 --- a/rosidl_typesupport_introspection_cpp/cmake/rosidl_typesupport_introspection_cpp_generate_interfaces.cmake +++ b/rosidl_typesupport_introspection_cpp/cmake/rosidl_typesupport_introspection_cpp_generate_interfaces.cmake @@ -108,7 +108,7 @@ endif() target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix} PUBLIC "$" - "$") + "$") # Depend on the library created by rosidl_generator_cpp target_link_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix} PUBLIC @@ -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" )