From f7bebe97598943c8989fe50910915738f3824a41 Mon Sep 17 00:00:00 2001 From: Emerson Knapp Date: Fri, 20 Mar 2026 09:59:10 -0700 Subject: [PATCH] Use new ROSIDL aggregate CMake target Signed-off-by: Emerson Knapp --- .../minimal_action_client/CMakeLists.txt | 8 ++++---- .../minimal_action_server/CMakeLists.txt | 6 +++--- .../minimal_composition/CMakeLists.txt | 2 +- rclcpp/executors/cbg_executor/CMakeLists.txt | 6 +++--- .../multithreaded_executor/CMakeLists.txt | 2 +- rclcpp/services/async_client/CMakeLists.txt | 2 +- rclcpp/services/minimal_client/CMakeLists.txt | 2 +- rclcpp/services/minimal_service/CMakeLists.txt | 2 +- rclcpp/topics/minimal_publisher/CMakeLists.txt | 12 ++++++------ .../topics/minimal_subscriber/CMakeLists.txt | 16 ++++++++-------- rclcpp/wait_set/CMakeLists.txt | 18 +++++++++--------- 11 files changed, 38 insertions(+), 38 deletions(-) diff --git a/rclcpp/actions/minimal_action_client/CMakeLists.txt b/rclcpp/actions/minimal_action_client/CMakeLists.txt index 67a7a2b0..20478765 100644 --- a/rclcpp/actions/minimal_action_client/CMakeLists.txt +++ b/rclcpp/actions/minimal_action_client/CMakeLists.txt @@ -18,25 +18,25 @@ find_package(rclcpp_action REQUIRED) add_executable(action_client_member_functions member_functions.cpp) target_link_libraries(action_client_member_functions PRIVATE - ${example_interfaces_TARGETS} + example_interfaces::example_interfaces rclcpp::rclcpp rclcpp_action::rclcpp_action) add_executable(action_client_not_composable not_composable.cpp) target_link_libraries(action_client_not_composable PRIVATE - ${example_interfaces_TARGETS} + example_interfaces::example_interfaces rclcpp::rclcpp rclcpp_action::rclcpp_action) add_executable(action_client_not_composable_with_cancel not_composable_with_cancel.cpp) target_link_libraries(action_client_not_composable_with_cancel PRIVATE - ${example_interfaces_TARGETS} + example_interfaces::example_interfaces rclcpp::rclcpp rclcpp_action::rclcpp_action) add_executable(action_client_not_composable_with_feedback not_composable_with_feedback.cpp) target_link_libraries(action_client_not_composable_with_feedback PRIVATE - ${example_interfaces_TARGETS} + example_interfaces::example_interfaces rclcpp::rclcpp rclcpp_action::rclcpp_action) diff --git a/rclcpp/actions/minimal_action_server/CMakeLists.txt b/rclcpp/actions/minimal_action_server/CMakeLists.txt index 77e1cf70..c934d852 100644 --- a/rclcpp/actions/minimal_action_server/CMakeLists.txt +++ b/rclcpp/actions/minimal_action_server/CMakeLists.txt @@ -18,19 +18,19 @@ find_package(rclcpp_action REQUIRED) add_executable(action_server_member_functions member_functions.cpp) target_link_libraries(action_server_member_functions PRIVATE - ${example_interfaces_TARGETS} + example_interfaces::example_interfaces rclcpp::rclcpp rclcpp_action::rclcpp_action) add_executable(action_server_not_composable not_composable.cpp) target_link_libraries(action_server_not_composable PRIVATE - ${example_interfaces_TARGETS} + example_interfaces::example_interfaces rclcpp::rclcpp rclcpp_action::rclcpp_action) add_executable(action_server_single_goal single_goal.cpp) target_link_libraries(action_server_single_goal PRIVATE - ${example_interfaces_TARGETS} + example_interfaces::example_interfaces rclcpp::rclcpp rclcpp_action::rclcpp_action) diff --git a/rclcpp/composition/minimal_composition/CMakeLists.txt b/rclcpp/composition/minimal_composition/CMakeLists.txt index dd84eccc..210b197c 100644 --- a/rclcpp/composition/minimal_composition/CMakeLists.txt +++ b/rclcpp/composition/minimal_composition/CMakeLists.txt @@ -23,7 +23,7 @@ add_library(composition_nodes SHARED src/subscriber_node.cpp) target_compile_definitions(composition_nodes PRIVATE "MINIMAL_COMPOSITION_DLL") -target_link_libraries(composition_nodes PUBLIC rclcpp::rclcpp rclcpp_components::component ${std_msgs_TARGETS}) +target_link_libraries(composition_nodes PUBLIC rclcpp::rclcpp rclcpp_components::component std_msgs::std_msgs) # This package installs libraries without exporting them. # Export the library path to ensure that the installed libraries are available. diff --git a/rclcpp/executors/cbg_executor/CMakeLists.txt b/rclcpp/executors/cbg_executor/CMakeLists.txt index e444336b..405e1e8e 100644 --- a/rclcpp/executors/cbg_executor/CMakeLists.txt +++ b/rclcpp/executors/cbg_executor/CMakeLists.txt @@ -21,7 +21,7 @@ add_executable( src/examples_rclcpp_cbg_executor/ping_node.cpp ) target_include_directories(ping PUBLIC include) -target_link_libraries(ping PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(ping PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable( pong @@ -29,7 +29,7 @@ add_executable( src/examples_rclcpp_cbg_executor/pong_node.cpp ) target_include_directories(pong PUBLIC include) -target_link_libraries(pong PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(pong PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable( ping_pong @@ -38,7 +38,7 @@ add_executable( src/examples_rclcpp_cbg_executor/pong_node.cpp ) target_include_directories(ping_pong PUBLIC include) -target_link_libraries(ping_pong PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(ping_pong PRIVATE rclcpp::rclcpp std_msgs::std_msgs) install(TARGETS ping pong ping_pong DESTINATION lib/${PROJECT_NAME} diff --git a/rclcpp/executors/multithreaded_executor/CMakeLists.txt b/rclcpp/executors/multithreaded_executor/CMakeLists.txt index fbdb2a8d..a8e9e2bc 100644 --- a/rclcpp/executors/multithreaded_executor/CMakeLists.txt +++ b/rclcpp/executors/multithreaded_executor/CMakeLists.txt @@ -16,7 +16,7 @@ find_package(rclcpp REQUIRED) find_package(std_msgs REQUIRED) add_executable(multithreaded_executor multithreaded_executor.cpp) -target_link_libraries(multithreaded_executor PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(multithreaded_executor PRIVATE rclcpp::rclcpp std_msgs::std_msgs) install(TARGETS multithreaded_executor diff --git a/rclcpp/services/async_client/CMakeLists.txt b/rclcpp/services/async_client/CMakeLists.txt index 96187a73..73dd2a9c 100644 --- a/rclcpp/services/async_client/CMakeLists.txt +++ b/rclcpp/services/async_client/CMakeLists.txt @@ -16,7 +16,7 @@ find_package(example_interfaces REQUIRED) find_package(rclcpp REQUIRED) add_executable(client_main main.cpp) -target_link_libraries(client_main PRIVATE rclcpp::rclcpp ${example_interfaces_TARGETS}) +target_link_libraries(client_main PRIVATE rclcpp::rclcpp example_interfaces::example_interfaces) install(TARGETS client_main DESTINATION lib/${PROJECT_NAME}) diff --git a/rclcpp/services/minimal_client/CMakeLists.txt b/rclcpp/services/minimal_client/CMakeLists.txt index 8b05c75d..ba7b8aa4 100644 --- a/rclcpp/services/minimal_client/CMakeLists.txt +++ b/rclcpp/services/minimal_client/CMakeLists.txt @@ -16,7 +16,7 @@ find_package(example_interfaces REQUIRED) find_package(rclcpp REQUIRED) add_executable(client_main main.cpp) -target_link_libraries(client_main PRIVATE rclcpp::rclcpp ${example_interfaces_TARGETS}) +target_link_libraries(client_main PRIVATE rclcpp::rclcpp example_interfaces::example_interfaces) install(TARGETS client_main DESTINATION lib/${PROJECT_NAME}) diff --git a/rclcpp/services/minimal_service/CMakeLists.txt b/rclcpp/services/minimal_service/CMakeLists.txt index f8ce0a70..9cdb9c2e 100644 --- a/rclcpp/services/minimal_service/CMakeLists.txt +++ b/rclcpp/services/minimal_service/CMakeLists.txt @@ -16,7 +16,7 @@ find_package(example_interfaces REQUIRED) find_package(rclcpp REQUIRED) add_executable(service_main main.cpp) -target_link_libraries(service_main PRIVATE rclcpp::rclcpp ${example_interfaces_TARGETS}) +target_link_libraries(service_main PRIVATE rclcpp::rclcpp example_interfaces::example_interfaces) install(TARGETS service_main DESTINATION lib/${PROJECT_NAME}) diff --git a/rclcpp/topics/minimal_publisher/CMakeLists.txt b/rclcpp/topics/minimal_publisher/CMakeLists.txt index fe015f94..7f50378d 100644 --- a/rclcpp/topics/minimal_publisher/CMakeLists.txt +++ b/rclcpp/topics/minimal_publisher/CMakeLists.txt @@ -16,22 +16,22 @@ find_package(rclcpp REQUIRED) find_package(std_msgs REQUIRED) add_executable(publisher_lambda lambda.cpp) -target_link_libraries(publisher_lambda PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(publisher_lambda PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(publisher_member_function member_function.cpp) -target_link_libraries(publisher_member_function PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(publisher_member_function PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(publisher_member_function_with_type_adapter member_function_with_type_adapter.cpp) -target_link_libraries(publisher_member_function_with_type_adapter PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(publisher_member_function_with_type_adapter PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(publisher_member_function_with_unique_network_flow_endpoints member_function_with_unique_network_flow_endpoints.cpp) -target_link_libraries(publisher_member_function_with_unique_network_flow_endpoints PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(publisher_member_function_with_unique_network_flow_endpoints PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(publisher_wait_for_all_acked member_function_with_wait_for_all_acked.cpp) -target_link_libraries(publisher_wait_for_all_acked PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(publisher_wait_for_all_acked PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(publisher_not_composable not_composable.cpp) -target_link_libraries(publisher_not_composable PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(publisher_not_composable PRIVATE rclcpp::rclcpp std_msgs::std_msgs) install(TARGETS publisher_lambda diff --git a/rclcpp/topics/minimal_subscriber/CMakeLists.txt b/rclcpp/topics/minimal_subscriber/CMakeLists.txt index df72f5f4..8c29ebab 100644 --- a/rclcpp/topics/minimal_subscriber/CMakeLists.txt +++ b/rclcpp/topics/minimal_subscriber/CMakeLists.txt @@ -17,31 +17,31 @@ find_package(rclcpp_components REQUIRED) find_package(std_msgs REQUIRED) add_executable(subscriber_lambda lambda.cpp) -target_link_libraries(subscriber_lambda PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(subscriber_lambda PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(subscriber_member_function member_function.cpp) -target_link_libraries(subscriber_member_function PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(subscriber_member_function PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(subscriber_member_function_with_topic_statistics member_function_with_topic_statistics.cpp) -target_link_libraries(subscriber_member_function_with_topic_statistics PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(subscriber_member_function_with_topic_statistics PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(subscriber_member_function_with_type_adapter member_function_with_type_adapter.cpp) -target_link_libraries(subscriber_member_function_with_type_adapter PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(subscriber_member_function_with_type_adapter PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(subscriber_member_function_with_unique_network_flow_endpoints member_function_with_unique_network_flow_endpoints.cpp) -target_link_libraries(subscriber_member_function_with_unique_network_flow_endpoints PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(subscriber_member_function_with_unique_network_flow_endpoints PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(subscriber_not_composable not_composable.cpp) -target_link_libraries(subscriber_not_composable PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(subscriber_not_composable PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(subscriber_content_filtering content_filtering.cpp) -target_link_libraries(subscriber_content_filtering PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(subscriber_content_filtering PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_library(wait_set_subscriber_library SHARED wait_set_subscriber.cpp static_wait_set_subscriber.cpp time_triggered_wait_set_subscriber.cpp) -target_link_libraries(wait_set_subscriber_library PRIVATE rclcpp::rclcpp rclcpp_components::component ${std_msgs_TARGETS}) +target_link_libraries(wait_set_subscriber_library PRIVATE rclcpp::rclcpp rclcpp_components::component std_msgs::std_msgs) rclcpp_components_register_node(wait_set_subscriber_library PLUGIN "WaitSetSubscriber" diff --git a/rclcpp/wait_set/CMakeLists.txt b/rclcpp/wait_set/CMakeLists.txt index a9c0550b..ac9d47c5 100644 --- a/rclcpp/wait_set/CMakeLists.txt +++ b/rclcpp/wait_set/CMakeLists.txt @@ -21,7 +21,7 @@ include_directories(include) add_library(talker SHARED src/talker.cpp) target_compile_definitions(talker PRIVATE WAIT_SET_DLL) -target_link_libraries(talker PUBLIC rclcpp::rclcpp rclcpp_components::component ${std_msgs_TARGETS}) +target_link_libraries(talker PUBLIC rclcpp::rclcpp rclcpp_components::component std_msgs::std_msgs) rclcpp_components_register_node( talker PLUGIN "Talker" @@ -29,32 +29,32 @@ rclcpp_components_register_node( add_library(listener SHARED src/listener.cpp) target_compile_definitions(listener PRIVATE WAIT_SET_DLL) -target_link_libraries(listener PUBLIC rclcpp::rclcpp rclcpp_components::component ${std_msgs_TARGETS}) +target_link_libraries(listener PUBLIC rclcpp::rclcpp rclcpp_components::component std_msgs::std_msgs) rclcpp_components_register_node( listener PLUGIN "Listener" EXECUTABLE wait_set_listener) add_executable(wait_set src/wait_set.cpp) -target_link_libraries(wait_set PRIVATE ${example_interfaces_TARGETS} rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(wait_set PRIVATE example_interfaces::example_interfaces rclcpp::rclcpp std_msgs::std_msgs) add_executable(static_wait_set src/static_wait_set.cpp) -target_link_libraries(static_wait_set PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(static_wait_set PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(thread_safe_wait_set src/thread_safe_wait_set.cpp) -target_link_libraries(thread_safe_wait_set PRIVATE ${example_interfaces_TARGETS} rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(thread_safe_wait_set PRIVATE example_interfaces::example_interfaces rclcpp::rclcpp std_msgs::std_msgs) add_executable(wait_set_topics_and_timer src/wait_set_topics_and_timer.cpp) -target_link_libraries(wait_set_topics_and_timer PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(wait_set_topics_and_timer PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(wait_set_random_order src/wait_set_random_order.cpp) -target_link_libraries(wait_set_random_order PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(wait_set_random_order PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(executor_random_order src/executor_random_order.cpp) -target_link_libraries(executor_random_order PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(executor_random_order PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(wait_set_topics_with_different_rates src/wait_set_topics_with_different_rates.cpp) -target_link_libraries(wait_set_topics_with_different_rates PRIVATE rclcpp::rclcpp ${std_msgs_TARGETS}) +target_link_libraries(wait_set_topics_with_different_rates PRIVATE rclcpp::rclcpp std_msgs::std_msgs) add_executable(wait_set_composed src/wait_set_composed.cpp) target_link_libraries(wait_set_composed PRIVATE talker listener rclcpp::rclcpp)