forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
363 lines (325 loc) · 10.1 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
cmake_minimum_required(VERSION 3.5)
project(drake-superbuild)
include(CTest)
include(cmake/config.cmake)
include(cmake/externals.cmake)
include(cmake/examples.cmake)
include(cmake/options.cmake)
include(cmake/tools.cmake)
include(cmake/git/hooks.cmake)
drake_setup_superbuild()
drake_setup_platform()
drake_setup_tools_superbuild()
drake_setup_git_hooks()
drake_setup_options()
###############################################################################
# BEGIN external projects
# External projects in order of dependencies; 'trivial' ones first
drake_add_external(avl PUBLIC CMAKE FORTRAN)
drake_add_external(eigen PUBLIC CMAKE)
drake_add_external(meshconverters PUBLIC CMAKE)
drake_add_external(qt_property_browser CMAKE QT)
drake_add_external(sedumi PUBLIC CMAKE MATLAB)
drake_add_external(spdlog PUBLIC CMAKE)
drake_add_external(spotless PUBLIC CMAKE MATLAB)
drake_add_external(swigmake PUBLIC CMAKE MATLAB PYTHON)
drake_add_external(xfoil PUBLIC CMAKE FORTRAN)
drake_add_external(yalmip PUBLIC CMAKE MATLAB)
# bullet
drake_add_external(bullet PUBLIC CMAKE
CMAKE_ARGS
-DBUILD_SHARED_LIBS=ON
-DBUILD_BULLET2_DEMOS=OFF
-DBUILD_CPU_DEMOS=OFF
-DBUILD_EXTRAS=OFF
-DBUILD_OPENGL3_DEMOS=OFF
-DBUILD_UNIT_TESTS=OFF
-DCMAKE_DEBUG_POSTFIX=
-DCMAKE_MINSIZEREL_POSTFIX=
-DCMAKE_RELWITHDEBINFO_POSTFIX=
-DINSTALL_LIBS=ON
-DPKGCONFIG_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig
-DUSE_DOUBLE_PRECISION=ON)
# ccd
drake_add_external(ccd PUBLIC CMAKE
CMAKE_ARGS
-DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=OFF
-DENABLE_DOUBLE_PRECISION=ON)
# dreal
drake_add_external(dreal PUBLIC CMAKE PYTHON
CMAKE_ARGS
-DBUILD_TESTING=OFF
-DSUPPORT_ODE=OFF
-DUSE_NLOPT=OFF
SOURCE_SUBDIR src)
# gflags
drake_add_external(gflags PUBLIC CMAKE
CMAKE_ARGS
-DBUILD_SHARED_LIBS=ON
-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON
-DGFLAGS_BUILD_gflags_nothreads_LIB=OFF)
# googletest
drake_add_external(googletest PUBLIC CMAKE
CMAKE_ARGS
-DBUILD_SHARED_LIBS=ON
-DCMAKE_INSTALL_NAME_DIR=${CMAKE_INSTALL_PREFIX}/lib)
# google_styleguide
drake_add_external(google_styleguide PUBLIC PYTHON
BUILD_COMMAND :)
# gurobi
drake_add_external(gurobi CMAKE MATLAB
CMAKE_ARGS
-DBUILD_TESTING=OFF
-DWITH_CPP=ON
-DWITH_MATLAB=${Matlab_FOUND}
-DWITH_PYTHON=OFF)
# ipopt
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Work around horrific clang* = clang, */cl* = msvc bug in BuildTools/coin.m4
get_filename_component(IPOPT_C_COMPILER "${CMAKE_C_COMPILER}" NAME)
get_filename_component(IPOPT_CXX_COMPILER "${CMAKE_CXX_COMPILER}" NAME)
else()
set(IPOPT_C_COMPILER "${CMAKE_C_COMPILER}")
set(IPOPT_CXX_COMPILER "${CMAKE_CXX_COMPILER}")
endif()
drake_add_external(ipopt PUBLIC AUTOTOOLS FORTRAN
AUTOTOOLS_ENV
CC=${IPOPT_C_COMPILER}
CXX=${IPOPT_CXX_COMPILER}
AUTOTOOLS_CONFIGURE_ARGS
--disable-shared
--includedir=${CMAKE_INSTALL_PREFIX}/include/ipopt
--with-blas=BUILD
--with-lapack=BUILD
--with-pic)
# mosek
drake_add_external(mosek PUBLIC CMAKE MATLAB
CMAKE_ARGS
-DBUILD_TESTING=OFF
-DWITH_MATLAB=${Matlab_FOUND}
-DWITH_PYTHON=OFF)
# nlopt
drake_add_external(nlopt PUBLIC CMAKE
CMAKE_ARGS
-DBUILD_SHARED_LIBS=ON
-DBUILD_PYTHON=OFF
-DBUILD_OCTAVE=OFF
-DBUILD_MATLAB=OFF
-DBUILD_GUILE=OFF
-DINSTALL_INCLUDE_DIR=${CMAKE_INSTALL_PREFIX}/include/nlopt
-DUSE_SWIG=OFF)
# pythonqt
drake_add_external(pythonqt CMAKE PYTHON QT
CMAKE_ARGS
-DPythonQt_Wrap_Qtcore:BOOL=ON
-DPythonQt_Wrap_Qtgui:BOOL=ON
-DPythonQt_Wrap_Qtuitools:BOOL=ON
)
# snopt
drake_add_external(snopt CMAKE MATLAB
CMAKE_ARGS
-DBUILD_SNOPT_CPP=OFF
-DBUILD_SHARED_LIBS=OFF # For licensing reasons
-DBUILD_TESTING=OFF
-DBUILD_SNOPT_C_MEX=${Matlab_FOUND}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON)
# octomap
drake_add_external(octomap PUBLIC CMAKE
CMAKE_ARGS
-DBUILD_TESTING=OFF
-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON
SOURCE_SUBDIR octomap)
# vtk
drake_add_external(vtk PUBLIC CMAKE PYTHON QT
CMAKE_ARGS
-DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=OFF
-DBUILD_EXAMPLES=OFF
-DVTK_USE_GUISUPPORT=ON
-DVTK_USE_QT=ON
-DVTK_WRAP_PYTHON=ON
-DVTK_WRAP_TCL=OFF
-DVTK_USE_TK=OFF)
# fcl
drake_add_external(fcl PUBLIC CMAKE
CMAKE_ARGS -DFCL_BUILD_TESTS=OFF
DEPENDS ccd eigen octomap)
# swig_matlab
drake_add_external(swig_matlab PUBLIC AUTOTOOLS
PATCH_COMMAND ./autogen.sh
AUTOTOOLS_CONFIGURE_ARGS
--without-alllang)
# textbook
drake_add_external(textbook PUBLIC CMAKE MATLAB PYTHON
CMAKE_ARGS -DBUILD_TESTING=${Matlab_FOUND}
INSTALL_COMMAND :
SOURCE_DIR ${PROJECT_SOURCE_DIR}/drake/doc/textbook)
# yaml_cpp
drake_add_external(yaml_cpp PUBLIC CMAKE
CMAKE_ARGS
-DBUILD_SHARED_LIBS=ON
-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON
-DYAML_CPP_BUILD_CONTRIB=OFF
-DYAML_CPP_BUILD_TOOLS=OFF)
# ctk_python_console
drake_add_external(ctk_python_console CMAKE PYTHON QT
DEPENDS pythonqt)
# iris
drake_add_external(iris PUBLIC CMAKE MATLAB PYTHON
CMAKE_ARGS
-DBUILD_TESTING=OFF
-DIRIS_WITH_CDD=ON
-DIRIS_WITH_EIGEN=OFF
-DIRIS_WITH_MOSEK=OFF
DEPENDS eigen mosek)
# lcm
drake_add_external(lcm PUBLIC CMAKE PYTHON
CMAKE_ARGS
-DBUILD_SHARED_LIBS=ON
-DLCM_ENABLE_EXAMPLES=OFF
-DLCM_ENABLE_LUA=OFF
-DLCM_ENABLE_TESTS=OFF
-DLCM_INSTALL_M4MACROS=OFF)
# libbot
drake_add_external(libbot PUBLIC CMAKE PYTHON
DEPENDS lcm)
# bot_core_lcmtypes
drake_add_external(bot_core_lcmtypes PUBLIC CMAKE PYTHON
DEPENDS lcm libbot) # Conflicts with libbot; ensure this is built after
# robotlocomotion_lcmtypes
drake_add_external(robotlocomotion_lcmtypes PUBLIC CMAKE PYTHON
DEPENDS bot_core_lcmtypes lcm)
# signalscope
drake_add_external(signalscope PUBLIC CMAKE PYTHON QT
DEPENDS ctk_python_console lcm pythonqt)
# Option to skip building drake proper via the superbuild. This allows the
# superbuild to build everything BUT drake, which can still be built separately
# from its build directory. This is used by the dashboards to make separate
# submissions for drake proper and the superbuild without drake. Some users may
# also find it useful, especially to build drake with ninja using fewer than
# the default number of jobs.
option(SKIP_DRAKE_BUILD "Build external projects but not drake itself" OFF)
# drake: For drake, list both compilation AND RUNTIME dependencies. Runtime
# dependencies are needed because the drake project must configure only after
# any dependencies used by MATLAB have been installed.
# TODO: re-add TEST to drake flags when subprojects arrive
drake_add_external(drake LOCAL PUBLIC CMAKE ALWAYS MATLAB PYTHON VTK
SOURCE_DIR ${PROJECT_SOURCE_DIR}/drake
BINARY_DIR ${PROJECT_BINARY_DIR}/drake
CMAKE_ARGS
-DDISABLE_MATLAB:BOOL=${DISABLE_MATLAB}
-DDISABLE_PYTHON:BOOL=${DISABLE_PYTHON}
-DDISABLE_FORTRAN:BOOL=${DISABLE_FORTRAN}
-DWITH_AVL:BOOL=${WITH_AVL}
-DWITH_BOT_CORE_LCMTYPES:BOOL=${WITH_BOT_CORE_LCMTYPES}
-DWITH_BULLET:BOOL=${WITH_BULLET}
-DWITH_CCD:BOOL=${WITH_CCD}
-DWITH_DREAL:BOOL=${WITH_DREAL}
-DWITH_EIGEN3:BOOL=${WITH_EIGEN} # TODO(jamiesnape): Fix naming inconsistency
-DWITH_FCL:BOOL=${WITH_FCL}
-DWITH_GFLAGS:BOOL=${WITH_GFLAGS}
-DWITH_GOOGLE_STYLEGUIDE:BOOL=${WITH_GOOGLE_STYLEGUIDE}
-DWITH_GTEST:BOOL=${WITH_GOOGLETEST} # TODO(jamiesnape): Fix naming inconsistency
-DWITH_GUROBI:BOOL=${WITH_GUROBI}
-DWITH_HSRB_DESCRIPTION:BOOL=${WITH_HSRB_DESCRIPTION}
-DWITH_IPOPT:BOOL=${WITH_IPOPT}
-DWITH_IRIS:BOOL=${WITH_IRIS}
-DWITH_LCM:BOOL=${WITH_LCM}
-DWITH_LIBBOT:BOOL=${WITH_LIBBOT}
-DWITH_MESHCONVERTERS:BOOL=${WITH_MESHCONVERTERS}
-DWITH_MOSEK:BOOL=${WITH_MOSEK}
-DWITH_NLOPT:BOOL=${WITH_NLOPT}
-DWITH_OCTOMAP:BOOL=${WITH_OCTOMAP}
-DWITH_PYTHON_3:BOOL=${WITH_PYTHON_3}
-DWITH_SEDUMI:BOOL=${WITH_SEDUMI}
-DWITH_SIGNALSCOPE:BOOL=${WITH_SIGNALSCOPE}
-DWITH_SNOPT:BOOL=${WITH_SNOPT}
-DWITH_SPDLOG:BOOL=${WITH_SPDLOG}
-DWITH_SPOTLESS:BOOL=${WITH_SPOTLESS}
-DWITH_SWIG:BOOL=${WITH_SWIG_MATLAB} # TODO(jamiesnape): Fix naming inconsistency
-DWITH_SWIGMAKE:BOOL=${WITH_SWIGMAKE}
-DWITH_TEXTBOOK:BOOL=${WITH_TEXTBOOK}
-DWITH_XFOIL:BOOL=${WITH_XFOIL}
-DWITH_YALMIP:BOOL=${WITH_YALMIP}
-DWITH_YAML_CPP:BOOL=${WITH_YAML_CPP}
-DUSE_CLANG_TIDY:BOOL=${USE_CLANG_TIDY}
-DUSE_INCLUDE_WHAT_YOU_USE:BOOL=${USE_INCLUDE_WHAT_YOU_USE}
-DUSE_LINK_WHAT_YOU_USE:BOOL=${USE_LINK_WHAT_YOU_USE}
-DUSE_SANITIZER:STRING=${USE_SANITIZER}
-DUSE_VALGRIND:STRING=${USE_VALGRIND}
DEPENDS
avl
bot_core_lcmtypes
bullet
ccd
dreal
eigen
fcl
gflags
google_styleguide
googletest
gurobi
ipopt
iris
lcm
libbot
meshconverters
mosek
nlopt
octomap
robotlocomotion_lcmtypes
sedumi
snopt
spdlog
spotless
swig_matlab
swigmake
textbook
vtk
xfoil
yalmip
yaml_cpp
)
# director
if(APPLE)
# TODO(patmarion): fix director tests on macOS and re-add TEST always
set(TEST_DIRECTOR)
else()
set(TEST_DIRECTOR TEST)
endif()
drake_add_external(director PUBLIC CMAKE ${TEST_DIRECTOR} PYTHON QT VTK
CMAKE_ARGS
-DUSE_DRAKE=ON
-DUSE_LCM=${HAVE_LCM}
-DUSE_LCMGL=${HAVE_LIBBOT}
-DUSE_LIBBOT=OFF
-DENABLE_TESTING=ON
DEPENDS
bot_core_lcmtypes
ctk_python_console
drake
lcm
libbot
pythonqt
qt_property_browser
vtk
)
# END external projects
###############################################################################
# BEGIN examples
# Optional examples
drake_add_example(LittleDog OFF
"planning and control for a small quadruped robot")
# END examples
###############################################################################
# hsrb_description is a ROS package that contains a model of Toyota's Human
# Support Robot (HSR). The following method call downloads hsrb_description as a
# submodule in drake-distro/ros/ but does not build or install it since it uses
# the Catkin build system and should only be compiled when Drake is installed as
# a ROS Catkin package. For details on how to do this, see:
# http://drake.mit.edu/from_source_ros.html.
drake_add_external(hsrb_description PUBLIC
SOURCE_DIR ${PROJECT_SOURCE_DIR}/ros/hsrb_description
BUILD_COMMAND :
INSTALL_COMMAND :)