diff --git a/rosidl_typesupport_introspection_c/CMakeLists.txt b/rosidl_typesupport_introspection_c/CMakeLists.txt index 8167725f9..83cf87a1d 100644 --- a/rosidl_typesupport_introspection_c/CMakeLists.txt +++ b/rosidl_typesupport_introspection_c/CMakeLists.txt @@ -40,6 +40,10 @@ ament_index_register_resource("rosidl_runtime_packages") if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) + find_package(rosidl_typesupport_interface REQUIRED) + # Give cppcheck hints about macro definitions coming from outside this package + get_target_property( + ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS rosidl_typesupport_interface::rosidl_typesupport_interface INTERFACE_INCLUDE_DIRECTORIES) ament_lint_auto_find_test_dependencies() endif() diff --git a/rosidl_typesupport_introspection_cpp/CMakeLists.txt b/rosidl_typesupport_introspection_cpp/CMakeLists.txt index c1d8b83cd..238e78c55 100644 --- a/rosidl_typesupport_introspection_cpp/CMakeLists.txt +++ b/rosidl_typesupport_introspection_cpp/CMakeLists.txt @@ -45,6 +45,10 @@ ament_index_register_resource("rosidl_runtime_packages") if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) + find_package(rosidl_typesupport_interface REQUIRED) + # Give cppcheck hints about macro definitions coming from outside this package + get_target_property( + ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS rosidl_typesupport_interface::rosidl_typesupport_interface INTERFACE_INCLUDE_DIRECTORIES) ament_lint_auto_find_test_dependencies() endif()