From 9f7f9f62fd7fb99ed69bccac84081e4c8768ea9d Mon Sep 17 00:00:00 2001
From: Olivier Stasse <ostasse@laas.fr>
Date: Tue, 26 Jan 2016 14:36:10 +0100
Subject: [PATCH] [ros] Add srv install + messages generations for C++ and
 python.

---
 CMakeLists.txt | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac768ed..7f5130e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,8 +25,6 @@ find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation
 find_package(realtime_tools)
 find_package(Boost REQUIRED COMPONENTS program_options)
 
-catkin_package(CATKIN_DEPENDS message_runtime)
-
 
 ## LAAS cmake submodule part
 set(PROJECT_DESCRIPTION "Dynamic graph bridge library")
@@ -154,6 +152,11 @@ target_link_libraries(geometric_simu  ros_bridge ${Boost_LIBRARIES} dl)
 
 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 )
+
 #install ros executables
 install(PROGRAMS
   ${CMAKE_SOURCE_DIR}/scripts/robot_pose_publisher
@@ -164,5 +167,9 @@ install(PROGRAMS
 message(cmake_install_bindir " is ${CMAKE_INSTALL_BINDIR} ")
 install(TARGETS geometric_simu DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
 install(FILES manifest.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/)
+
+# Service file.
+install(FILES ./srv/RunPythonFile.srv DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/srv)
+
 SETUP_PROJECT_FINALIZE()
 
-- 
GitLab