forked from ut-amrl/spot_cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
227 lines (193 loc) · 5.34 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
cmake_minimum_required(VERSION 3.0.2)
project(spot_comm)
add_compile_options(-std=c++17)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(Eigen3 REQUIRED)
find_package(Protobuf CONFIG REQUIRED)
message(STATUS "Using protobuf ${protobuf_VERSION}")
set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf)
find_package(gRPC CONFIG REQUIRED)
set(_GRPC_GRPCPP gRPC::grpc++)
message(STATUS "Using gRPC ${gRPC_VERSION}")
find_package(Threads REQUIRED)
###########
## Build ##
###########
include_directories(
include
${Eigen_INCLUDE_DIRS}
${Protobuf_INCLUDE_DIRS}
)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
function(include_files name)
string(TOUPPER ${name} upperName)
set (${upperName} include/bosdyn/api/${name}.pb.cc
include/bosdyn/api/${name}.grpc.pb.cc
PARENT_SCOPE)
endfunction()
function(include_files_service name)
string(TOUPPER ${name} upperName)
set (${upperName} include/bosdyn/api/${name}.pb.cc
include/bosdyn/api/${name}.grpc.pb.cc
include/bosdyn/api/${name}_service.pb.cc
include/bosdyn/api/${name}_service.grpc.pb.cc
PARENT_SCOPE)
endfunction()
function(include_service name)
string(TOUPPER ${name} upperName)
set (${upperName} include/bosdyn/api/${name}_service.pb.cc
include/bosdyn/api/${name}_service.grpc.pb.cc
PARENT_SCOPE)
endfunction()
function(include_files_spot name)
string(TOUPPER ${name} upperName)
set (${upperName} include/bosdyn/api/spot/${name}.pb.cc
include/bosdyn/api/spot/${name}.grpc.pb.cc
PARENT_SCOPE)
endfunction()
function(include_files_spot_service name)
string(TOUPPER ${name} upperName)
set (${upperName} include/bosdyn/api/spot/${name}.pb.cc
include/bosdyn/api/spot/${name}.grpc.pb.cc
include/bosdyn/api/spot/${name}_service.pb.cc
include/bosdyn/api/spot/${name}_service.grpc.pb.cc
PARENT_SCOPE)
endfunction()
function(include_files_docking_service name)
string(TOUPPER ${name} upperName)
set (${upperName} include/bosdyn/api/docking/${name}.pb.cc
include/bosdyn/api/docking/${name}.grpc.pb.cc
include/bosdyn/api/docking/${name}_service.pb.cc
include/bosdyn/api/docking/${name}_service.grpc.pb.cc
PARENT_SCOPE)
endfunction()
# deps
include_files(header)
include_files(geometry)
include_files(trajectory)
include_files(arm_command)
include_files(full_body_command)
include_files(mobility_command)
include_files(basic_command)
include_files(gripper_command)
include_files(synchronized_command)
include_files(parameter)
include_files(service_fault)
include_files(payload_estimation)
include_files(time_range)
# base
include_files_service(auth)
include_files_service(directory)
include_files_service(log_annotation)
include_files_service(time_sync)
include_files_service(robot_id)
# payloads
include_files_service(directory_registration)
include_files_service(payload)
# state
include_files_service(image)
include_files_service(local_grid)
include_files_service(robot_state)
include_files_service(world_object)
# control
include_files_service(estop)
include_files_service(lease)
include_files_service(power)
include_files_service(robot_command)
include_files_spot_service(spot_check)
include_files_service(license)
# data
include_service(data)
include_files(data_index)
include_files(data_chunk)
include_files(data_acquisition_plugin_service)
include_files_service(data_acquisition)
include_files_service(data_store)
include_files_service(data_buffer)
# docking
include_files_docking_service(docking)
add_library(utspot SHARED
# clients
src/clients/auth.cpp
src/clients/image.cpp
src/clients/power.cpp
src/clients/robot_id.cpp
src/clients/spot_check.cpp
src/clients/timesync.cpp
src/clients/estop.cpp
src/clients/lease.cpp
src/clients/robot_command.cpp
src/clients/robot_state.cpp
src/clients/directory.cpp
src/clients/directory_registration.cpp
src/clients/local_grid.cpp
src/clients/spot_check.cpp
src/clients/world_objects.cpp
# layers
src/core_layer.cpp
src/robot_layer.cpp
# misc
src/trajectory.cpp
src/frame.cpp
src/math.cpp
src/spot.cpp
# deps
${HEADER}
${FULL_BODY_COMMAND}
${MOBILITY_COMMAND}
${BASIC_COMMAND}
${ARM_COMMAND}
${GRIPPER_COMMAND}
${SYNCHRONIZED_COMMAND}
${TIME_RANGE}
${PAYLOAD_ESTIMATION}
${TRAJECTORY}
${PARAMETER}
${GEOMETRY}
${TIME_SYNC}
${LICENSE}
${SERVICE_FAULT}
# temp
${DOCKING}
# base
${AUTH}
${DIRECTORY}
${LOG_ANNOTATION}
${ROBOT_ID}
${TIME_SYNC}
# payloads
${DIRECTORY_REGISTRATION}
${PAYLOAD}
# state
${IMAGE}
${LOCAL_GRID}
${ROBOT_STATE}
${WORLD_OBJECT}
# control
${ESTOP}
${LEASE}
${POWER}
${ROBOT_COMMAND}
${SPOT_CHECK}
include/bosdyn/api/spot/robot_command.pb.cc
include/bosdyn/api/spot/robot_command.grpc.pb.cc
# data
${DATA}
${DATA_INDEX}
${DATA_CHUNK}
${DATA_ACQUISITION_PLUGIN_SERVICE}
${DATA_ACQUISITION}
${DATA_ACQUISITION_STORE}
${DATA_BUFFER})
set(LINK_LIBRARIES
${Protobuf_LIBRARIES}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF}
Eigen3::Eigen
)
# link libraries to executable
target_link_libraries(utspot ${LINK_LIBRARIES})
install(TARGETS utspot DESTINATION lib)
install(DIRECTORY include/spot DESTINATION include/)
install(DIRECTORY include/bosdyn DESTINATION include/)