From efaae0f2c89baf8f1b3f34800ddd468bade93f4b Mon Sep 17 00:00:00 2001
From: Manfred Kroehnert <Manfred.Kroehnert@kit.edu>
Date: Fri, 21 Feb 2014 18:33:04 +0100
Subject: [PATCH] cmake: adapt to latest changes in ArmarXCore

---
 .../GraspingWithTorques/CMakeLists.txt        | 29 +++++--------
 source/RobotAPI/OpenHand/CMakeLists.txt       | 30 +++++--------
 .../ForceTorqueObserver/CMakeLists.txt        | 13 +++---
 .../applications/MotionControl/CMakeLists.txt | 13 +++---
 .../MotionControlTest/CMakeLists.txt          | 17 ++++----
 .../TCPControlUnit/CMakeLists.txt             | 17 ++++----
 source/RobotAPI/core/CMakeLists.txt           | 30 +++++--------
 source/RobotAPI/motioncontrol/CMakeLists.txt  | 28 +++++--------
 source/RobotAPI/units/CMakeLists.txt          | 42 ++++++++-----------
 9 files changed, 85 insertions(+), 134 deletions(-)

diff --git a/source/RobotAPI/GraspingWithTorques/CMakeLists.txt b/source/RobotAPI/GraspingWithTorques/CMakeLists.txt
index c9dd67ad3..6745f8d83 100644
--- a/source/RobotAPI/GraspingWithTorques/CMakeLists.txt
+++ b/source/RobotAPI/GraspingWithTorques/CMakeLists.txt
@@ -7,25 +7,18 @@ find_package(Simox QUIET)
 armarx_build_if(Eigen3_FOUND "Eigen3 not available")
 armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available")
 
-if (ARMARX_BUILD)
-    include_directories(${Eigen3_INCLUDE_DIR})
-    include_directories(${Simox_INCLUDE_DIRS})
+include_directories(${Eigen3_INCLUDE_DIR})
+include_directories(${Simox_INCLUDE_DIRS})
 
-    set(LIB_NAME       GraspingWithTorques)
-    set(LIB_VERSION    0.1.0)
-    set(LIB_SOVERSION  0)
+set(LIB_NAME       GraspingWithTorques)
+set(LIB_VERSION    0.1.0)
+set(LIB_SOVERSION  0)
 
-    set(LIBS RobotAPICore RobotAPIInterfaces ArmarXInterfaces ArmarXCore ArmarXCoreObservers)
+set(LIBS RobotAPICore RobotAPIInterfaces ArmarXInterfaces ArmarXCore ArmarXCoreObservers)
 
-    set(LIB_FILES GraspingWithTorques.cpp
-         )
-    set(LIB_HEADERS GraspingWithTorques.h
-         )
-
-    add_library(${LIB_NAME} SHARED ${LIB_FILES} ${LIB_HEADERS})
-
-    library_settings("${LIB_NAME}" "${LIB_VERSION}" "${LIB_SOVERSION}" "${LIB_HEADERS}")
-    target_link_ice(${LIB_NAME})
-    target_link_libraries(${LIB_NAME} ${LIBS})
-endif()
+set(LIB_FILES GraspingWithTorques.cpp
+     )
+set(LIB_HEADERS GraspingWithTorques.h
+     )
 
+armarx_add_library("${LIB_NAME}" "${LIB_VERSION}" "${LIB_SOVERSION}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}")
diff --git a/source/RobotAPI/OpenHand/CMakeLists.txt b/source/RobotAPI/OpenHand/CMakeLists.txt
index dd55325eb..3a9d3d37a 100644
--- a/source/RobotAPI/OpenHand/CMakeLists.txt
+++ b/source/RobotAPI/OpenHand/CMakeLists.txt
@@ -1,31 +1,23 @@
 armarx_set_target("RobotAPI Library: OpenHand")
 
-
 find_package(Eigen3 QUIET)
 find_package(Simox QUIET)
 
 armarx_build_if(Eigen3_FOUND "Eigen3 not available")
 armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available")
 
-if (ARMARX_BUILD)
-    include_directories(${Eigen3_INCLUDE_DIR})
-    include_directories(${Simox_INCLUDE_DIRS})
-
-    set(LIB_NAME       OpenHand)
-    set(LIB_VERSION    0.1.0)
-    set(LIB_SOVERSION  0)
-
-    set(LIBS RobotAPICore RobotAPIInterfaces ArmarXInterfaces ArmarXCore ArmarXCoreObservers)
+include_directories(${Eigen3_INCLUDE_DIR})
+include_directories(${Simox_INCLUDE_DIRS})
 
-    set(LIB_FILES OpenHand.cpp
-         )
-    set(LIB_HEADERS OpenHand.h
-         )
+set(LIB_NAME       OpenHand)
+set(LIB_VERSION    0.1.0)
+set(LIB_SOVERSION  0)
 
-    add_library(${LIB_NAME} SHARED ${LIB_FILES} ${LIB_HEADERS})
+set(LIBS RobotAPICore RobotAPIInterfaces ArmarXInterfaces ArmarXCore ArmarXCoreObservers)
 
-    library_settings("${LIB_NAME}" "${LIB_VERSION}" "${LIB_SOVERSION}" "${LIB_HEADERS}")
-    target_link_ice(${LIB_NAME})
-    target_link_libraries(${LIB_NAME} ${LIBS})
-endif()
+set(LIB_FILES OpenHand.cpp
+     )
+set(LIB_HEADERS OpenHand.h
+     )
 
+armarx_add_library("${LIB_NAME}" "${LIB_VERSION}" "${LIB_SOVERSION}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}")
diff --git a/source/RobotAPI/applications/ForceTorqueObserver/CMakeLists.txt b/source/RobotAPI/applications/ForceTorqueObserver/CMakeLists.txt
index ec2db460d..8398b7002 100755
--- a/source/RobotAPI/applications/ForceTorqueObserver/CMakeLists.txt
+++ b/source/RobotAPI/applications/ForceTorqueObserver/CMakeLists.txt
@@ -1,13 +1,12 @@
 
 armarx_component_set_name(ForceTorqueObserver)
 
-set(COMPONENT_BUILD TRUE)
+find_package(Eigen3 QUIET)
+armarx_build_if(Eigen3_FOUND "Eigen3 not available")
 
 find_package(Simox QUIET)
 armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available")
 
-armarx_build_if(COMPONENT_BUILD "component disabled")
-
 # check if ArmarXCoreUnits library gets built
 # LOCATION is NOT-FOUND (equal to FALSE) if library is disabled
 GET_TARGET_PROPERTY(ArmarXCoreUnits_ENABLED ArmarXCoreUnits LOCATION)
@@ -17,10 +16,8 @@ GET_TARGET_PROPERTY(ArmarXCoreObservers_ENABLED ArmarXCoreObservers LOCATION)
 armarx_build_if(ArmarXCoreObservers_ENABLED "ArmarXCoreObservers library disabled")
 
 
-if (ARMARX_BUILD)
-    set(COMPONENT_LIBS RobotAPIUnits RobotAPICore RobotAPIInterfaces  ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreRemoteRobot)
+set(COMPONENT_LIBS RobotAPIUnits RobotAPICore RobotAPIInterfaces  ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreRemoteRobot)
 
-    set(SOURCES main.cpp ForceTorqueObserverApp.h)
+set(SOURCES main.cpp ForceTorqueObserverApp.h)
 
-    armarx_add_component_executable("${SOURCES}")
-endif()
+armarx_add_component_executable("${SOURCES}")
diff --git a/source/RobotAPI/applications/MotionControl/CMakeLists.txt b/source/RobotAPI/applications/MotionControl/CMakeLists.txt
index 8ef8e1330..b7bf1b6df 100755
--- a/source/RobotAPI/applications/MotionControl/CMakeLists.txt
+++ b/source/RobotAPI/applications/MotionControl/CMakeLists.txt
@@ -1,13 +1,12 @@
 
 armarx_component_set_name(MotionControl)
 
-set(COMPONENT_BUILD TRUE)
+find_package(Eigen3 QUIET)
+armarx_build_if(Eigen3_FOUND "Eigen3 not available")
 
 find_package(Simox QUIET)
 armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available")
 
-armarx_build_if(COMPONENT_BUILD "component disabled")
-
 # check if ArmarXCoreUnits library gets built
 # LOCATION is NOT-FOUND (equal to FALSE) if library is disabled
 GET_TARGET_PROPERTY(ArmarXCoreUnits_ENABLED ArmarXCoreUnits LOCATION)
@@ -17,10 +16,8 @@ GET_TARGET_PROPERTY(ArmarXCoreObservers_ENABLED ArmarXCoreObservers LOCATION)
 armarx_build_if(ArmarXCoreObservers_ENABLED "ArmarXCoreObservers library disabled")
 
 
-if (ARMARX_BUILD)
-    set(COMPONENT_LIBS MotionControl RobotAPICore ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreRobotStateComponent ArmarXCoreStatechart ArmarXCoreOperations)
+set(COMPONENT_LIBS MotionControl RobotAPICore ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreRobotStateComponent ArmarXCoreStatechart ArmarXCoreOperations)
 
-    set(SOURCES main.cpp MotionControlApp.h)
+set(SOURCES main.cpp MotionControlApp.h)
 
-    armarx_add_component_executable("${SOURCES}")
-endif()
+armarx_add_component_executable("${SOURCES}")
diff --git a/source/RobotAPI/applications/MotionControlTest/CMakeLists.txt b/source/RobotAPI/applications/MotionControlTest/CMakeLists.txt
index d3aa79752..ce7392449 100644
--- a/source/RobotAPI/applications/MotionControlTest/CMakeLists.txt
+++ b/source/RobotAPI/applications/MotionControlTest/CMakeLists.txt
@@ -1,13 +1,12 @@
 
 armarx_component_set_name(MotionControlTest)
 
-set(COMPONENT_BUILD TRUE)
+find_package(Eigen3 QUIET)
+armarx_build_if(Eigen3_FOUND "Eigen3 not available")
 
 find_package(Simox QUIET)
 armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available")
 
-armarx_build_if(COMPONENT_BUILD "component disabled")
-
 # check if ArmarXCoreUnits library gets built
 # LOCATION is NOT-FOUND (equal to FALSE) if library is disabled
 GET_TARGET_PROPERTY(ArmarXCoreUnits_ENABLED ArmarXCoreUnits LOCATION)
@@ -17,12 +16,10 @@ GET_TARGET_PROPERTY(ArmarXCoreObservers_ENABLED ArmarXCoreObservers LOCATION)
 armarx_build_if(ArmarXCoreObservers_ENABLED "ArmarXCoreObservers library disabled")
 
 
-if (ARMARX_BUILD)
-    include_directories(${Eigen3_INCLUDE_DIR})
-    include_directories(${Simox_INCLUDE_DIRS})
-    set(COMPONENT_LIBS MotionControl RobotAPICore ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreRobotStateComponent ArmarXCoreStatechart ArmarXCoreOperations ${Simox_LIBRARIES})
+include_directories(${Eigen3_INCLUDE_DIR})
+include_directories(${Simox_INCLUDE_DIRS})
+set(COMPONENT_LIBS MotionControl RobotAPICore ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreRobotStateComponent ArmarXCoreStatechart ArmarXCoreOperations ${Simox_LIBRARIES})
 
-    set(SOURCES main.cpp MotionControlTestApp.h)
+set(SOURCES main.cpp MotionControlTestApp.h)
 
-    armarx_add_component_executable("${SOURCES}")
-endif()
+armarx_add_component_executable("${SOURCES}")
diff --git a/source/RobotAPI/applications/TCPControlUnit/CMakeLists.txt b/source/RobotAPI/applications/TCPControlUnit/CMakeLists.txt
index 81d0f4e07..492c1aded 100755
--- a/source/RobotAPI/applications/TCPControlUnit/CMakeLists.txt
+++ b/source/RobotAPI/applications/TCPControlUnit/CMakeLists.txt
@@ -1,13 +1,12 @@
 
 armarx_component_set_name(TCPControlUnit)
 
-set(COMPONENT_BUILD TRUE)
+find_package(Eigen3 QUIET)
+armarx_build_if(Eigen3_FOUND "Eigen3 not available")
 
 find_package(Simox QUIET)
 armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available")
 
-armarx_build_if(COMPONENT_BUILD "component disabled")
-
 # check if ArmarXCoreUnits library gets built
 # LOCATION is NOT-FOUND (equal to FALSE) if library is disabled
 GET_TARGET_PROPERTY(ArmarXCoreUnits_ENABLED ArmarXCoreUnits LOCATION)
@@ -17,12 +16,10 @@ GET_TARGET_PROPERTY(ArmarXCoreObservers_ENABLED ArmarXCoreObservers LOCATION)
 armarx_build_if(ArmarXCoreObservers_ENABLED "ArmarXCoreObservers library disabled")
 
 
-if (ARMARX_BUILD)
-    include_directories(${Eigen3_INCLUDE_DIR})
-    include_directories(${Simox_INCLUDE_DIRS})
-    set(COMPONENT_LIBS RobotAPIUnits RobotAPICore RobotAPIInterfaces  ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreRemoteRobot ${Simox_LIBRARIES})
+include_directories(${Eigen3_INCLUDE_DIR})
+include_directories(${Simox_INCLUDE_DIRS})
+set(COMPONENT_LIBS RobotAPIUnits RobotAPICore RobotAPIInterfaces  ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreRemoteRobot ${Simox_LIBRARIES})
 
-    set(SOURCES main.cpp TCPControlUnitApp.h)
+set(SOURCES main.cpp TCPControlUnitApp.h)
 
-    armarx_add_component_executable("${SOURCES}")
-endif()
+armarx_add_component_executable("${SOURCES}")
diff --git a/source/RobotAPI/core/CMakeLists.txt b/source/RobotAPI/core/CMakeLists.txt
index bce671fb8..e403fbf60 100644
--- a/source/RobotAPI/core/CMakeLists.txt
+++ b/source/RobotAPI/core/CMakeLists.txt
@@ -7,26 +7,18 @@ find_package(Simox QUIET)
 armarx_build_if(Eigen3_FOUND "Eigen3 not available")
 armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available")
 
-if (ARMARX_BUILD)
-    include_directories(${Eigen3_INCLUDE_DIR})
-    include_directories(${Simox_INCLUDE_DIRS})
+include_directories(${Eigen3_INCLUDE_DIR})
+include_directories(${Simox_INCLUDE_DIRS})
 
-    set(LIB_NAME       RobotAPICore)
-    set(LIB_VERSION    0.1.0)
-    set(LIB_SOVERSION  0)
+set(LIB_NAME       RobotAPICore)
+set(LIB_VERSION    0.1.0)
+set(LIB_SOVERSION  0)
 
-    set(LIBS RobotAPIInterfaces ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreStatechart ArmarXCoreRobotStateComponent ${Simox_LIBRARIES})
+set(LIBS RobotAPIInterfaces ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreStatechart ArmarXCoreRobotStateComponent ${Simox_LIBRARIES})
 
-    set(LIB_FILES RobotStatechartContext.cpp
-    )
-    set(LIB_HEADERS RobotStatechartContext.h
-    )
-
-
-    add_library(${LIB_NAME} SHARED ${LIB_FILES} ${LIB_HEADERS})
-
-    library_settings("${LIB_NAME}" "${LIB_VERSION}" "${LIB_SOVERSION}" "${LIB_HEADERS}")
-    target_link_ice(${LIB_NAME})
-    target_link_libraries(${LIB_NAME} ${LIBS})
-endif()
+set(LIB_FILES RobotStatechartContext.cpp
+)
+set(LIB_HEADERS RobotStatechartContext.h
+)
 
+armarx_add_library("${LIB_NAME}" "${LIB_VERSION}" "${LIB_SOVERSION}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}")
diff --git a/source/RobotAPI/motioncontrol/CMakeLists.txt b/source/RobotAPI/motioncontrol/CMakeLists.txt
index 5f0d70238..c1f092140 100644
--- a/source/RobotAPI/motioncontrol/CMakeLists.txt
+++ b/source/RobotAPI/motioncontrol/CMakeLists.txt
@@ -7,25 +7,19 @@ find_package(Simox QUIET)
 armarx_build_if(Eigen3_FOUND "Eigen3 not available")
 armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available")
 
-if (ARMARX_BUILD)
-    include_directories(${Eigen3_INCLUDE_DIR})
-    include_directories(${Simox_INCLUDE_DIRS})
+include_directories(${Eigen3_INCLUDE_DIR})
+include_directories(${Simox_INCLUDE_DIRS})
 
-    set(LIB_NAME       MotionControl)
-    set(LIB_VERSION    0.1.0)
-    set(LIB_SOVERSION  0)
+set(LIB_NAME       MotionControl)
+set(LIB_VERSION    0.1.0)
+set(LIB_SOVERSION  0)
 
-    set(LIBS RobotAPICore RobotAPIInterfaces ArmarXInterfaces ArmarXCore ArmarXCoreObservers ${Simox_LIBRARIES})
+set(LIBS RobotAPICore RobotAPIInterfaces ArmarXInterfaces ArmarXCore ArmarXCoreObservers ${Simox_LIBRARIES})
 
-    set(LIB_FILES MotionControl.cpp
-         ZeroForceControl.cpp)
-    set(LIB_HEADERS MotionControl.h
-            ZeroForceControl.h)
+set(LIB_FILES MotionControl.cpp
+     ZeroForceControl.cpp)
+set(LIB_HEADERS MotionControl.h
+        ZeroForceControl.h)
 
-    add_library(${LIB_NAME} SHARED ${LIB_FILES} ${LIB_HEADERS})
-
-    library_settings("${LIB_NAME}" "${LIB_VERSION}" "${LIB_SOVERSION}" "${LIB_HEADERS}")
-    target_link_ice(${LIB_NAME})
-    target_link_libraries(${LIB_NAME} ${LIBS})
-endif()
+armarx_add_library("${LIB_NAME}" "${LIB_VERSION}" "${LIB_SOVERSION}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}")
 
diff --git a/source/RobotAPI/units/CMakeLists.txt b/source/RobotAPI/units/CMakeLists.txt
index 1e55aa781..3cb8f9450 100755
--- a/source/RobotAPI/units/CMakeLists.txt
+++ b/source/RobotAPI/units/CMakeLists.txt
@@ -7,33 +7,25 @@ find_package(Simox QUIET)
 armarx_build_if(Eigen3_FOUND "Eigen3 not available")
 armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available")
 
-if (ARMARX_BUILD)
-    include_directories(${Eigen3_INCLUDE_DIR})
-    include_directories(${Simox_INCLUDE_DIRS})
+include_directories(${Eigen3_INCLUDE_DIR})
+include_directories(${Simox_INCLUDE_DIRS})
 
-    set(LIB_NAME       RobotAPIUnits)
-    set(LIB_VERSION    0.1.0)
-    set(LIB_SOVERSION  0)
+set(LIB_NAME       RobotAPIUnits)
+set(LIB_VERSION    0.1.0)
+set(LIB_SOVERSION  0)
 
-    set(LIBS RobotAPIInterfaces RobotAPICore ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreRemoteRobot  ${Simox_LIBRARIES})
+set(LIBS RobotAPIInterfaces RobotAPICore ArmarXInterfaces ArmarXCore ArmarXCoreObservers ArmarXCoreRemoteRobot  ${Simox_LIBRARIES})
 
-    set(LIB_HEADERS
-        ForceTorqueObserver.h
-        TCPControlUnit.h
-        TCPControlUnitObserver.h
+set(LIB_HEADERS
+    ForceTorqueObserver.h
+    TCPControlUnit.h
+    TCPControlUnitObserver.h
 
-    )
-    set(LIB_FILES
-        ForceTorqueObserver.cpp
-        TCPControlUnit.cpp
-        TCPControlUnitObserver.cpp
-    )
-
-
-    add_library(${LIB_NAME} SHARED ${LIB_FILES} ${LIB_HEADERS})
-
-    library_settings("${LIB_NAME}" "${LIB_VERSION}" "${LIB_SOVERSION}" "${LIB_HEADERS}")
-    target_link_ice(${LIB_NAME})
-    target_link_libraries(${LIB_NAME} ${LIBS})
-endif()
+)
+set(LIB_FILES
+    ForceTorqueObserver.cpp
+    TCPControlUnit.cpp
+    TCPControlUnitObserver.cpp
+)
 
+armarx_add_library("${LIB_NAME}" "${LIB_VERSION}" "${LIB_SOVERSION}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}")
-- 
GitLab