This repository has been archived by the owner on Apr 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
132 lines (110 loc) · 3.64 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#
# (C) Copyright 2016-2023 Johns Hopkins University (JHU), All Rights Reserved.
#
# --- begin cisst license - do not edit ---
#
# This software is provided "as is" under an open source license, with
# no warranty. The complete license can be found in license.txt and
# http://www.cisst.org/cisst/license.txt.
#
# --- end cisst license ---
cmake_minimum_required (VERSION 3.10)
project (mts_galil_controller VERSION 0.0.0)
include_directories (include)
add_subdirectory (share)
# create a list of required cisst libraries
set (REQUIRED_CISST_LIBRARIES
cisstCommon
cisstVector
cisstOSAbstraction
cisstMultiTask
cisstParameterTypes
)
find_package (cisst 1.2.0 REQUIRED ${REQUIRED_CISST_LIBRARIES})
set( catkin_REQUIRED_COMPONENTS
roscpp
rospy
std_msgs
geometry_msgs
cisst_msgs
cisst_ros_bridge
)
find_package(catkin REQUIRED COMPONENTS
${catkin_REQUIRED_COMPONENTS}
)
include_directories(${catkin_INCLUDE_DIRS})
catkin_package(
INCLUDE_DIRS include
LIBRARIES mtsGalilController
CATKIN_DEPENDS ${catkin_REQUIRED_COMPONENTS}
)
set ( mtsGalilController_HEADER_FILES
include/mtsGalilController/GalilControllerInterface.h
include/mtsGalilController/mtsGalilController.h
)
set ( mtsGalilController_SOURCE_FILES
code/GalilControllerInterface.cpp
code/mtsGalilController.cpp
)
if (cisst_FOUND_AS_REQUIRED)
# load cisst configuration
include (${CISST_USE_FILE})
if (NOT CISST_HAS_JSON)
message( FATAL_ERROR "mtsGalilController requires cisst to be built with JSON" )
endif ()
# catkin/ROS paths
cisst_set_output_path ()
catkin_package(
LIBRARIES mtsGalilController
INCLUDE_DIRS include
CATKIN_DEPENDS ${catkin_REQUIRED_COMPONENTS}
)
# add all config files for this component
cisst_add_config_files (mtsGalilController)
add_library (mtsGalilController
${mtsGalilController_SOURCE_FILES}
)
cisst_target_link_libraries (mtsGalilController ${REQUIRED_CISST_LIBRARIES})
set_target_properties (mtsGalilController PROPERTIES
VERSION ${mts_galil_controller_VERSION}
FOLDER "mtsGalilController"
PUBLIC_HEADER "${mtsGalilController_HEADER_FILES}"
)
target_include_directories(mtsGalilController PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_link_libraries (mtsGalilController
${catkin_LIBRARIES}
-lgclib
-lgclibo
)
add_executable(mtsGalilController_Test
code/main.cpp
)
target_link_libraries(mtsGalilController_Test mtsGalilController ${catkin_LIBRARIES})
cisst_target_link_libraries(mtsGalilController_Test ${REQUIRED_CISST_LIBRARIES})
# Install target for headers and library
install (
DIRECTORY "${mts_galil_controller_SOURCE_DIR}/include/mtsGalilController"
DESTINATION include
COMPONENT mtsGalilController-dev
PATTERN .svn EXCLUDE
)
install (
TARGETS mtsGalilController
COMPONENT mtsGalilController
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(TARGETS mtsGalilController
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY include/mtsGalilController/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
else (cisst_FOUND_AS_REQUIRED)
message ("Information: code in ${CMAKE_CURRENT_SOURCE_DIR} will not be compiled, it requires ${REQUIRED_CISST_LIBRARIES}")
endif (cisst_FOUND_AS_REQUIRED)