diff --git a/CMakeLists.txt b/CMakeLists.txt index 769abb8..213ec66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,13 +23,7 @@ find_package(std_msgs REQUIRED) find_package(tf2_ros REQUIRED) find_package(urdf REQUIRED) -add_library( - ${PROJECT_NAME}_node SHARED - src/robot_state_publisher.cpp) -target_include_directories(${PROJECT_NAME}_node PUBLIC - "$" - "$") -ament_target_dependencies(${PROJECT_NAME}_node +set(THIS_PACKAGE_INCLUDE_DEPENDS builtin_interfaces geometry_msgs kdl_parser @@ -40,8 +34,15 @@ ament_target_dependencies(${PROJECT_NAME}_node sensor_msgs std_msgs tf2_ros - urdf -) + urdf) + +add_library( + ${PROJECT_NAME}_node SHARED + src/robot_state_publisher.cpp) +target_include_directories(${PROJECT_NAME}_node PUBLIC + "$" + "$") +ament_target_dependencies(${PROJECT_NAME}_node ${THIS_PACKAGE_INCLUDE_DEPENDS}) ament_export_targets(export_${PROJECT_NAME}_node) rclcpp_components_register_node(${PROJECT_NAME}_node @@ -114,5 +115,5 @@ if(BUILD_TESTING) ARGS "test_exe:=$") endif() -ament_export_dependencies(builtin_interfaces orocos_kdl rclcpp sensor_msgs std_msgs tf2_ros urdf) +ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS}) ament_package() diff --git a/package.xml b/package.xml index e7ead29..e352dd1 100644 --- a/package.xml +++ b/package.xml @@ -13,29 +13,17 @@ ament_cmake - builtin_interfaces - geometry_msgs - kdl_parser - orocos_kdl - rcl_interfaces - rclcpp - rclcpp_components - sensor_msgs - std_msgs - tf2_ros - urdf - - builtin_interfaces - geometry_msgs - kdl_parser - orocos_kdl - rcl_interfaces - rclcpp - rclcpp_components - sensor_msgs - std_msgs - tf2_ros - urdf + builtin_interfaces + geometry_msgs + kdl_parser + orocos_kdl + rcl_interfaces + rclcpp + rclcpp_components + sensor_msgs + std_msgs + tf2_ros + urdf ament_cmake_gtest ament_lint_auto