From 8a8bc15abc16d9a32438c1ac7b3c8a84af503717 Mon Sep 17 00:00:00 2001 From: Olivier Stasse <ostasse@laas.fr> Date: Tue, 4 Oct 2016 02:09:15 +0200 Subject: [PATCH] [cmake/ros] Fix problem with generation of catkin pc file. Add proper dependence to the SoT packages. --- CMakeLists.txt | 30 ++++++++++++++++++++++-------- package.xml | 40 ++++++++++++++++++++-------------------- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a43e0e..5c86ea6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,17 +56,24 @@ set(PKG_CONFIG_ADDITIONAL_VARIABLES plugindir ) +# Add dependency to SoT specific packages. +SET(SOT_PKGNAMES +sot-core +sot-dynamic +jrl-dynamics-urdf +dynamic_graph_bridge_msgs) + add_required_dependency(roscpp) add_required_dependency("realtime_tools >= 1.8") add_required_dependency(bullet) -add_required_dependency(jrl-mal) -add_required_dependency(dynamic-graph) -add_required_dependency(dynamic-graph-python) -add_required_dependency(sot-core) -add_required_dependency(sot-dynamic) -add_required_dependency(jrl-dynamics-urdf) -add_required_dependency(dynamic_graph_bridge_msgs) +foreach(sot_pkgname ${SOT_PKGNAMES}) + add_required_dependency(${sot_pkgname}) + pkg_check_modules(SOT_${sot_pkgname} REQUIRED ${sot_pkgname}) +endforeach(sot_pkgname) + + +# Build ros_bridge library add_library(ros_bridge src/converter.hh include/dynamic_graph_bridge/ros_init.hh src/ros_init.cpp @@ -115,6 +122,7 @@ endmacro() include(cmake/python.cmake) +# Build Sot Entities compile_plugin(ros_publish) compile_plugin(ros_subscribe) compile_plugin(ros_time) @@ -169,7 +177,13 @@ add_subdirectory(src) # Deal with the ROS part. add_service_files( FILES RunPythonFile.srv ) generate_messages( DEPENDENCIES std_msgs ) -catkin_package(CATKIN_DEPENDS message_runtime LIBRARIES ros_bridge ros_interpreter) + +# This is necessary so that the pc file generated by catking is similar to the on +# done directly by jrl-cmake-modules +catkin_package(CATKIN_DEPENDS message_runtime roscpp realtime_tools bullet ${SOT_PKGNAMES} +LIBRARIES ros_bridge ros_interpreter +) + # Add libraries in pc file generated by cmake submodule PKG_CONFIG_APPEND_LIBS(ros_bridge ros_interpreter) diff --git a/package.xml b/package.xml index a3a33b8..e76547a 100644 --- a/package.xml +++ b/package.xml @@ -1,6 +1,6 @@ -<package> +<package format="2"> <name>dynamic_graph_bridge</name> - <version>2.0.6</version> + <version>2.0.8</version> <description> ROS bindings for dynamic graph. @@ -18,22 +18,22 @@ <buildtool_depend>catkin</buildtool_depend> - <build_depend>std_msgs</build_depend> - <build_depend>std_srvs</build_depend> - <build_depend>roscpp</build_depend> - <build_depend>geometry_msgs</build_depend> - <build_depend>sensor_msgs</build_depend> - <build_depend>tf</build_depend> - <build_depend>realtime_tools</build_depend> - <build_depend>message_generation</build_depend> - - - <run_depend>std_msgs</run_depend> - <run_depend>std_srvs</run_depend> - <run_depend>roscpp</run_depend> - <run_depend>geometry_msgs</run_depend> - <run_depend>sensor_msgs</run_depend> - <run_depend>tf</run_depend> - <run_depend>realtime_tools</run_depend> - <run_depend>message_runtime</run_depend> + <depend>std_msgs</depend> + <depend>std_srvs</depend> + <depend>roscpp</depend> + <depend>geometry_msgs</depend> + <depend>sensor_msgs</depend> + <depend>tf</depend> + <depend>realtime_tools</depend> + <depend>message_generation</depend> + <depend>message_runtime</depend> + + <depend>bullet</depend> + <depend>jrl-mal</depend> + <depend>dynamic-graph</depend> + <depend>dynamic-graph-python</depend> + <depend>sot-core</depend> + <depend>sot-dynamic</depend> + <depend>jrl-dynamics-urdf</depend> + <depend>dynamic_graph_bridge_msgs</depend> </package> -- GitLab