From b9d87a6abcdc8ae4204148de81ea5acdf2fab06c Mon Sep 17 00:00:00 2001 From: "David V. Lu" Date: Wed, 7 May 2025 21:12:14 -0400 Subject: [PATCH 1/3] [kilted] Update deprecated call to ament_target_dependencies --- imu_complementary_filter/CMakeLists.txt | 2 +- imu_filter_madgwick/CMakeLists.txt | 2 +- rviz_imu_plugin/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/imu_complementary_filter/CMakeLists.txt b/imu_complementary_filter/CMakeLists.txt index cd1d015a..fc6b77ff 100644 --- a/imu_complementary_filter/CMakeLists.txt +++ b/imu_complementary_filter/CMakeLists.txt @@ -24,7 +24,7 @@ target_compile_features(complementary_filter PUBLIC c_std_99 cxx_std_17) # Requ target_include_directories(complementary_filter PUBLIC $ $) -ament_target_dependencies(complementary_filter +target_link_libraries(complementary_filter PUBLIC geometry_msgs message_filters rclcpp diff --git a/imu_filter_madgwick/CMakeLists.txt b/imu_filter_madgwick/CMakeLists.txt index 9a9d5040..86f15c76 100644 --- a/imu_filter_madgwick/CMakeLists.txt +++ b/imu_filter_madgwick/CMakeLists.txt @@ -22,7 +22,7 @@ target_compile_features(imu_filter_madgwick PUBLIC c_std_99 cxx_std_17) # Requi target_include_directories(imu_filter_madgwick PUBLIC $ $) -ament_target_dependencies(imu_filter_madgwick +target_link_libraries(imu_filter_madgwick PUBLIC geometry_msgs rclcpp rclcpp_components diff --git a/rviz_imu_plugin/CMakeLists.txt b/rviz_imu_plugin/CMakeLists.txt index 993a8355..86cd5daa 100644 --- a/rviz_imu_plugin/CMakeLists.txt +++ b/rviz_imu_plugin/CMakeLists.txt @@ -61,7 +61,7 @@ add_library(${PROJECT_NAME} SHARED ${SRC_FILES}) ## the ``find_package(Qt4 ...)`` line above, or by the ## ``set(QT_LIBRARIES Qt5::Widgets)``, and with whatever libraries ## catkin has included. -ament_target_dependencies(${PROJECT_NAME} PUBLIC ${dependencies}) +target_link_libraries(${PROJECT_NAME} PUBLIC ${dependencies}) target_link_libraries(${PROJECT_NAME} PUBLIC rviz_ogre_vendor::OgreMain rviz_ogre_vendor::OgreOverlay Qt5::Widgets) From 5510b186698eb725d73c4a5bd29cdfd934bc4a78 Mon Sep 17 00:00:00 2001 From: "David V. Lu" Date: Wed, 7 May 2025 22:21:40 -0400 Subject: [PATCH 2/3] Combine target_link_libraries --- rviz_imu_plugin/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rviz_imu_plugin/CMakeLists.txt b/rviz_imu_plugin/CMakeLists.txt index 86cd5daa..5450553d 100644 --- a/rviz_imu_plugin/CMakeLists.txt +++ b/rviz_imu_plugin/CMakeLists.txt @@ -61,9 +61,7 @@ add_library(${PROJECT_NAME} SHARED ${SRC_FILES}) ## the ``find_package(Qt4 ...)`` line above, or by the ## ``set(QT_LIBRARIES Qt5::Widgets)``, and with whatever libraries ## catkin has included. -target_link_libraries(${PROJECT_NAME} PUBLIC ${dependencies}) - -target_link_libraries(${PROJECT_NAME} PUBLIC rviz_ogre_vendor::OgreMain rviz_ogre_vendor::OgreOverlay Qt5::Widgets) +target_link_libraries(${PROJECT_NAME} PUBLIC ${dependencies} rviz_ogre_vendor::OgreMain rviz_ogre_vendor::OgreOverlay Qt5::Widgets) # prevent pluginlib from using boost target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS") From b86b3b643572f967866d520306b1e2a931cff751 Mon Sep 17 00:00:00 2001 From: "David V. Lu" Date: Thu, 8 May 2025 16:05:47 -0400 Subject: [PATCH 3/3] Fix targets --- imu_complementary_filter/CMakeLists.txt | 15 ++++++++------- imu_filter_madgwick/CMakeLists.txt | 16 +++++++++------- rviz_imu_plugin/CMakeLists.txt | 3 ++- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/imu_complementary_filter/CMakeLists.txt b/imu_complementary_filter/CMakeLists.txt index fc6b77ff..8486d3e0 100644 --- a/imu_complementary_filter/CMakeLists.txt +++ b/imu_complementary_filter/CMakeLists.txt @@ -25,13 +25,14 @@ target_include_directories(complementary_filter PUBLIC $ $) target_link_libraries(complementary_filter PUBLIC - geometry_msgs - message_filters - rclcpp - sensor_msgs - std_msgs - tf2 - tf2_ros + ${geometry_msgs_TARGETS} + ${sensor_msgs_TARGETS} + ${std_msgs_TARGETS} + message_filters::message_filters + rclcpp::rclcpp + sensor_msgs::sensor_msgs_library + tf2::tf2 + tf2_ros::tf2_ros ) # Causes the visibility macros to use dllexport rather than dllimport, # which is appropriate when building the dll but not consuming it. diff --git a/imu_filter_madgwick/CMakeLists.txt b/imu_filter_madgwick/CMakeLists.txt index 86f15c76..f14e8b17 100644 --- a/imu_filter_madgwick/CMakeLists.txt +++ b/imu_filter_madgwick/CMakeLists.txt @@ -23,13 +23,15 @@ target_include_directories(imu_filter_madgwick PUBLIC $ $) target_link_libraries(imu_filter_madgwick PUBLIC - geometry_msgs - rclcpp - rclcpp_components - sensor_msgs - std_msgs - tf2_geometry_msgs - tf2_ros + ${geometry_msgs_TARGETS} + ${sensor_msgs_TARGETS} + ${std_msgs_TARGETS} + rclcpp::rclcpp + rclcpp_components::component + rclcpp_components::component_manager + sensor_msgs::sensor_msgs_library + tf2_geometry_msgs::tf2_geometry_msgs + tf2_ros::tf2_ros ) rclcpp_components_register_nodes(imu_filter_madgwick "ImuFilterMadgwickRos") target_compile_definitions(imu_filter_madgwick diff --git a/rviz_imu_plugin/CMakeLists.txt b/rviz_imu_plugin/CMakeLists.txt index 5450553d..5141255d 100644 --- a/rviz_imu_plugin/CMakeLists.txt +++ b/rviz_imu_plugin/CMakeLists.txt @@ -61,7 +61,8 @@ add_library(${PROJECT_NAME} SHARED ${SRC_FILES}) ## the ``find_package(Qt4 ...)`` line above, or by the ## ``set(QT_LIBRARIES Qt5::Widgets)``, and with whatever libraries ## catkin has included. -target_link_libraries(${PROJECT_NAME} PUBLIC ${dependencies} rviz_ogre_vendor::OgreMain rviz_ogre_vendor::OgreOverlay Qt5::Widgets) + +target_link_libraries(${PROJECT_NAME} PUBLIC rviz_ogre_vendor::OgreMain rviz_ogre_vendor::OgreOverlay Qt5::Widgets ${sensor_msgs_TARGETS} message_filters::message_filters rviz_common::rviz_common rviz_ogre_vendor::OgreMain rviz_rendering::rviz_rendering sensor_msgs::sensor_msgs_library tf2::tf2 tf2_ros::tf2_ros) # prevent pluginlib from using boost target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")