diff --git a/sensor_msgs/CMakeLists.txt b/sensor_msgs/CMakeLists.txt index 3653b211..6eafb6e7 100644 --- a/sensor_msgs/CMakeLists.txt +++ b/sensor_msgs/CMakeLists.txt @@ -73,6 +73,12 @@ if(TARGET ${cpp_target}) install( TARGETS ${PROJECT_NAME}_library EXPORT export_${PROJECT_NAME} ) + + # Export old-style CMake variables + ament_export_include_directories("include/${PROJECT_NAME}") + + # Export modern CMake targets + ament_export_targets(export_${PROJECT_NAME}) endif() if(BUILD_TESTING) @@ -89,12 +95,6 @@ if(BUILD_TESTING) target_link_libraries(test_sensor_msgs "${cpp_typesupport_target}") endif() -# Export old-style CMake variables -ament_export_include_directories("include/${PROJECT_NAME}") - -# Export modern CMake targets -ament_export_targets(export_${PROJECT_NAME}) - ament_export_dependencies(rosidl_default_runtime) ament_package()