From 5015357ca6b6fa99651f5489e0d0a01c41953db3 Mon Sep 17 00:00:00 2001
From: Sergi Hernandez Juan <shernand@iri.upc.edu>
Date: Wed, 20 Jun 2018 15:04:27 +0200
Subject: [PATCH] Added the roscpp dependency.

---
 CMakeLists.txt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ad90c9..5e6cf16 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@ project(iri_ros_tools)
 ## Find catkin macros and libraries
 ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
 ## is used, also find other catkin packages
-find_package(catkin REQUIRED)
+find_package(catkin REQUIRED COMPONENTS roscpp)
 
 ## System dependencies are found with CMake's conventions
 # find_package(Boost REQUIRED COMPONENTS system)
@@ -88,16 +88,19 @@ catkin_package(
 ## Specify additional locations of header files
 ## Your package locations should be listed before other locations
 include_directories(include)
+include_directories(${catkin_INCLUDE_DIRS})
 
 ## Declare a cpp library
 # add_library(iri_ros_tool
 #   src/${PROJECT_NAME}/iri_ros_tool.cpp
 # )
 add_library(${PROJECT_NAME} src/timeout.cpp src/watchdog.cpp)
+target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})
 
 add_library(modules include/${PROJECT_NAME}/module_common.h include/${PROJECT_NAME}/module.h include/${PROJECT_NAME}/module_service.h include/${PROJECT_NAME}/module_action.h include/${PROJECT_NAME}/module_exceptions.h include/${PROJECT_NAME}/module_dyn_reconf.h)
 set_target_properties(modules PROPERTIES LINKER_LANGUAGE CXX)
 target_link_libraries(modules ${PROJECT_NAME})
+target_link_libraries(modules ${catkin_LIBRARIES})
 
 
 ## Declare a cpp executable
-- 
GitLab