diff --git a/rmw_fastrtps_cpp/CMakeLists.txt b/rmw_fastrtps_cpp/CMakeLists.txt index a479fb531..7a086e258 100644 --- a/rmw_fastrtps_cpp/CMakeLists.txt +++ b/rmw_fastrtps_cpp/CMakeLists.txt @@ -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) @@ -159,7 +160,7 @@ ament_package( install( DIRECTORY include/ - DESTINATION include + DESTINATION include/${PROJECT_NAME} ) install( diff --git a/rmw_fastrtps_dynamic_cpp/CMakeLists.txt b/rmw_fastrtps_dynamic_cpp/CMakeLists.txt index 2d747fd37..de6be2bbe 100644 --- a/rmw_fastrtps_dynamic_cpp/CMakeLists.txt +++ b/rmw_fastrtps_dynamic_cpp/CMakeLists.txt @@ -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) @@ -169,7 +170,7 @@ ament_package( install( DIRECTORY include/ - DESTINATION include + DESTINATION include/${PROJECT_NAME} ) install( diff --git a/rmw_fastrtps_shared_cpp/CMakeLists.txt b/rmw_fastrtps_shared_cpp/CMakeLists.txt index 6427ea44f..3c30f3101 100644 --- a/rmw_fastrtps_shared_cpp/CMakeLists.txt +++ b/rmw_fastrtps_shared_cpp/CMakeLists.txt @@ -93,7 +93,7 @@ add_library(rmw_fastrtps_shared_cpp target_include_directories(rmw_fastrtps_shared_cpp PUBLIC "$" - "$") + "$") target_link_libraries(rmw_fastrtps_shared_cpp fastcdr fastrtps ) @@ -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) @@ -133,7 +136,7 @@ ament_package( install( DIRECTORY include/ - DESTINATION include + DESTINATION include/${PROJECT_NAME} ) install(