-
Notifications
You must be signed in to change notification settings - Fork 16
/
CMakeLists.txt
199 lines (147 loc) · 3.5 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
cmake_minimum_required(VERSION 2.8.3)
project(tansa)
option(BUILD_GAZEBO "Builds support for the Gazebo simulator" ON)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(Boost COMPONENTS system filesystem REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(CGAL)
find_package(Cplex)
include_directories(
${EIGEN3_INCLUDE_DIR}
include
)
if(CGAL_FOUND)
set(CGAL_DONT_OVERRIDE_CMAKE_FLAGS TRUE CACHE BOOL "Force CGAL to maintain CMAKE flags")
include(${CGAL_USE_FILE})
endif()
######## Headers and libraries for prebuilt socket.io client ########
include_directories(
lib/socket.io-client-cpp/build/include
)
link_directories(
build_socketio_cpp
)
######## Main Tansa Library ########
add_library(
tansa SHARED
src/core/core.cpp
src/core/data.cpp
src/core/vehicle.cpp
src/core/vehicle_time.cpp
src/core/vehicle_params.cpp
src/core/time.cpp
src/core/messaging.cpp
src/algorithm/assignment_solver.cpp
src/algorithm/rigid_transform.cpp
src/algorithm/rigid_point_correspondence_solver.cpp
src/server/osc.cpp
src/control/position.cpp
src/estimation/linear_complementary.cpp
src/trajectory/polynomial.cpp
src/trajectory/minsnap.cpp
src/trajectory/linear.cpp
src/trajectory/ellipse.cpp
src/trajectory/point.cpp
src/trajectory/spiral.cpp
#src/trajectory/gradual_circle.cpp
src/jocs/routine.cpp
src/jocs/csv.cpp
src/jocs/jocsParser.cpp
src/jocs/action.cpp
src/jocs/jocsPlayer.cpp
src/trajectory/light.cpp
src/trajectory/strobe.cpp
src/control/lightcontrol.cpp
src/model/feasibility.cpp
#src/control/admittance.cpp
src/manager/preview.cpp
src/manager/calibration.cpp
# Simulation
src/simulate/simulation.cpp
src/simulate/motor.cpp
src/simulate/model.cpp
src/simulate/multirotor.cpp
src/simulate/firmware.cpp
src/simulate/battery.cpp
src/simulate/sensors/imu.cpp
src/simulate/sensors/gps.cpp
)
target_link_libraries(
tansa
pthread
sioclient
${Boost_LIBRARIES}
)
set_target_properties(tansa PROPERTIES COMPILE_FLAGS "-std=c++1y -Wall")
if(CGAL_FOUND)
target_link_libraries(
tansa
${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} # TODO: Also add CGAL_CXX_* flags
)
add_definitions(-DUSE_CGAL)
endif()
## We can optionally build with CPLEX
if(CPLEX_FOUND)
target_include_directories(
tansa PRIVATE
${CPLEX_INCLUDE_DIRS}
)
target_link_libraries(
tansa
${CPLEX_LIBRARIES}
)
add_definitions(-DUSE_CPLEX)
endif()
######## Extensions ########
if(BUILD_GAZEBO)
add_subdirectory(src/gazebo)
add_definitions(-DUSE_GAZEBO)
endif()
add_subdirectory(src/mocap)
######## Test Suite ########
enable_testing()
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})
add_executable(
test_tansa
test/main.cpp
test/core/time.cpp
test/algorithm/assignment_solver.cpp
test/algorithm/disjoint_sets.cpp
test/algorithm/rigid_point_correspondence_solver.cpp
test/jocs/jocsParser.cpp
test/mocap/rigid_body_tracker.cpp
)
set_target_properties(test_tansa PROPERTIES COMPILE_FLAGS "-std=c++11 -O3 -w -g")
target_link_libraries(test_tansa ${GTEST_BOTH_LIBRARIES} tansa)
add_test(TansaTests test_tansa)
######## CLI Demo ########
add_executable(
gcs
src/custom.cpp
src/gcs.cpp
)
target_link_libraries(
gcs
pthread
tansa
tansa_mocap
)
if(BUILD_GAZEBO)
target_link_libraries(
gcs
tansa_gazebo
)
endif()
set_target_properties(gcs PROPERTIES COMPILE_FLAGS "-std=c++1y")
###### Simple Demo ######
add_executable(
simple
src/simple.cpp
)
target_link_libraries(
simple
pthread
tansa
)
set_target_properties(simple PROPERTIES COMPILE_FLAGS "-std=c++1y")