diff --git a/rclcpp/CMakeLists.txt b/rclcpp/CMakeLists.txt index ac7db1af6e..754d095521 100644 --- a/rclcpp/CMakeLists.txt +++ b/rclcpp/CMakeLists.txt @@ -238,10 +238,6 @@ install( RUNTIME DESTINATION bin ) -# Export old-style CMake variables -ament_export_include_directories("include/${PROJECT_NAME}") -ament_export_libraries(${PROJECT_NAME}) - # Export modern CMake targets ament_export_targets(${PROJECT_NAME}) diff --git a/rclcpp_action/CMakeLists.txt b/rclcpp_action/CMakeLists.txt index 4eefd6af2d..37084c9728 100644 --- a/rclcpp_action/CMakeLists.txt +++ b/rclcpp_action/CMakeLists.txt @@ -64,10 +64,6 @@ install( RUNTIME DESTINATION bin ) -# Export old-style CMake variables -ament_export_include_directories("include/${PROJECT_NAME}") -ament_export_libraries(${PROJECT_NAME}) - # Export modern CMake targets ament_export_targets(${PROJECT_NAME}) @@ -77,7 +73,8 @@ if(BUILD_TESTING) find_package(ament_cmake_gtest REQUIRED) find_package(ament_lint_auto REQUIRED) # Give cppcheck hints about macro definitions coming from outside this package - set(ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS ${rclcpp_INCLUDE_DIRS}) + get_target_property(rclcpp_include_dirs rclcpp::rclcpp INTERFACE_INCLUDE_DIRECTORIES) + set(ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS ${rclcpp_include_dirs}) ament_lint_auto_find_test_dependencies() add_subdirectory(test/benchmark) diff --git a/rclcpp_components/CMakeLists.txt b/rclcpp_components/CMakeLists.txt index e4bd0c71cb..e9d5924703 100644 --- a/rclcpp_components/CMakeLists.txt +++ b/rclcpp_components/CMakeLists.txt @@ -167,10 +167,6 @@ install( DESTINATION share/${PROJECT_NAME} ) -# Export old-style CMake variables -ament_export_include_directories("include/${PROJECT_NAME}") -ament_export_libraries(component_manager) - # Export modern CMake targets ament_export_targets(export_${PROJECT_NAME}) diff --git a/rclcpp_lifecycle/CMakeLists.txt b/rclcpp_lifecycle/CMakeLists.txt index b625194817..0515296b96 100644 --- a/rclcpp_lifecycle/CMakeLists.txt +++ b/rclcpp_lifecycle/CMakeLists.txt @@ -58,7 +58,8 @@ install(DIRECTORY include/ if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) # Give cppcheck hints about macro definitions coming from outside this package - set(ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS ${rclcpp_INCLUDE_DIRS}) + get_target_property(rclcpp_include_dirs rclcpp::rclcpp INTERFACE_INCLUDE_DIRECTORIES) + set(ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS ${rclcpp_include_dirs}) list(APPEND AMENT_LINT_AUTO_EXCLUDE "ament_cmake_cppcheck") ament_lint_auto_find_test_dependencies() @@ -185,10 +186,6 @@ if(BUILD_TESTING) endif() endif() -# Export old-style CMake variables -ament_export_include_directories("include/${PROJECT_NAME}") -ament_export_libraries(${PROJECT_NAME}) - # Export modern CMake targets ament_export_targets(${PROJECT_NAME})