From e8479a8e4e0ab6a9ef86aff127a594b0f919bfe2 Mon Sep 17 00:00:00 2001
From: Olivier Stasse <ostasse@laas.fr>
Date: Mon, 26 Feb 2018 10:50:28 +0100
Subject: [PATCH] [cmake] Makes CMakeLists.txt independent from the branch.

---
 talos_roscontrol_sot/CMakeLists.txt | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/talos_roscontrol_sot/CMakeLists.txt b/talos_roscontrol_sot/CMakeLists.txt
index 451ef61..f0f7279 100644
--- a/talos_roscontrol_sot/CMakeLists.txt
+++ b/talos_roscontrol_sot/CMakeLists.txt
@@ -26,6 +26,8 @@ include(cmake/python.cmake)
 
 #project(talos_roscontrol_sot)
 
+OPTION(REAL_ROBOT "Compiling this package for the real robot" FALSE)
+
 find_package(PkgConfig REQUIRED)
 
 add_required_dependency(bullet)
@@ -36,6 +38,17 @@ add_required_dependency(bullet)
 ## Find catkin macros and libraries
 ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
 ## is used, also find other catkin packages
+if(${REAL_ROBOT})
+  set(additional_catkin_required_components
+    controller_interface
+    pal_hardware_interfaces
+    )
+else(${REAL_ROBOT})
+  set(additional_catkin_required_components
+    talos_controller_interface
+    talos_pal_hardware_interfaces
+    )
+endif(${REAL_ROBOT})
 find_package(catkin REQUIRED COMPONENTS
   roscpp
   rospy
@@ -44,7 +57,7 @@ find_package(catkin REQUIRED COMPONENTS
   control_msgs
   sensor_msgs
   realtime_tools
-  controller_interface
+  ${additional_catkin_required_components}
 )
 
 ## LAAS cmake submodule part
-- 
GitLab