-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
322 lines (249 loc) · 9.93 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
cmake_minimum_required(VERSION 2.8.3)
project(ein)
#SET (CMAKE_CXX_COMPILER "/home/stefie10/dev/pidrone/src/ein/timecpp.sh")
#SET (CMAKE_CXX_COMPILER "/usr/bin/clang++-5.0")
#SET (CMAKE_C_COMPILER "/usr/bin/clang-5.0")
#SET (CMAKE_AR "/usr/bin/llvm-ar-5.0")
#SET (CMAKE_LINKER "/usr/bin/llvm-ld-5.0")
#SET (CMAKE_NM "/usr/bin/llvm-nm-5.0")
#SET (CMAKE_OBJDUMP "/usr/bin/llvm-objdump-5.0")
#SET (CMAKE_RANLIB "/usr/bin/llvm-ranlib-5.0")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/ein/cmake")
MESSAGE(CMAKE_MODULE_PATH)
MESSAGE(${CMAKE_MODULE_PATH})
find_package(OpenCV 2)
find_package(catkin REQUIRED COMPONENTS
cmake_modules
roscpp
rospy
std_msgs
object_recognition_msgs
geometry_msgs
visualization_msgs
tf_conversions
genmsg
cv_bridge
image_transport
message_generation
control_msgs
)
find_package(LAPACK REQUIRED)
find_package(GSL REQUIRED)
find_package(ZLIB REQUIRED)
find_package(OpenGL)
find_package(GLUT)
find_package(GLEW)
find_package(OpenCL)
add_message_files(
FILES
EinState.msg
EinConsole.msg
)
generate_messages(
DEPENDENCIES
std_msgs
object_recognition_msgs
)
catkin_package(CATKIN_DEPENDS
eigen
message_runtime
std_msgs
object_recognition_msgs
)
include_directories(include
${catkin_INCLUDE_DIRS}
${EIGEN_INCLUDE_DIRS}
)
set(OPENMP_FLAG "-fopenmp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENMP_FLAG} -g -std=c++11 -fpermissive -Wno-deprecated-register -Wno-parentheses")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENMP_FLAG} -O3 -std=c++11 -fpermissive")
set(CMAKE_BUILD_TYPE Debug)
find_package (Qt5Widgets)
set (EinQtLib_src ${PROJECT_SOURCE_DIR}/src/qtgui/mainwindow.cpp ${PROJECT_SOURCE_DIR}/src/qtgui/einwindow.cpp
${PROJECT_SOURCE_DIR}/src/qtgui/window_QT.cpp ${PROJECT_SOURCE_DIR}/src/qtgui/stackmodel.cpp ${PROJECT_SOURCE_DIR}/src/qtgui/windowmanager.cpp
${PROJECT_SOURCE_DIR}/src/qtgui/wordaction.cpp ${PROJECT_SOURCE_DIR}/src/qtgui/armwidget.cpp ${PROJECT_SOURCE_DIR}/src/qtgui/gaussianmapwidget.cpp
${PROJECT_SOURCE_DIR}/src/qtgui/gaussianmapwindow.cpp ${PROJECT_SOURCE_DIR}/src/qtgui/streamviewerwindow.cpp ${PROJECT_SOURCE_DIR}/src/qtgui/discrepancywindow.cpp
${PROJECT_SOURCE_DIR}/src/qtgui/capturelineedit.cpp
${PROJECT_SOURCE_DIR}/src/qtgui/qt_util.cpp
)
set (EinQtLib_hdr ${PROJECT_SOURCE_DIR}/src/qtgui/mainwindow.h ${PROJECT_SOURCE_DIR}/src/qtgui/einwindow.h ${PROJECT_SOURCE_DIR}/src/qtgui/window_QT.h ${PROJECT_SOURCE_DIR}/src/qtgui/stackmodel.h ${PROJECT_SOURCE_DIR}/src/qtgui/windowmanager.h ${PROJECT_SOURCE_DIR}/src/qtgui/wordaction.h ${PROJECT_SOURCE_DIR}/src/qtgui/armwidget.h
${PROJECT_SOURCE_DIR}/src/qtgui/wordaction.h ${PROJECT_SOURCE_DIR}/src/qtgui/gaussianmapwidget.h ${PROJECT_SOURCE_DIR}/src/qtgui/streamviewerwindow.h
${PROJECT_SOURCE_DIR}/src/qtgui/gaussianmapwindow.h
${PROJECT_SOURCE_DIR}/src/qtgui/discrepancywindow.h
${PROJECT_SOURCE_DIR}/src/qtgui/capturelineedit.h)
set (EinQtLib_ui ${PROJECT_SOURCE_DIR}/src/qtgui/mainwindow.ui ${PROJECT_SOURCE_DIR}/src/qtgui/einwindow.ui ${PROJECT_SOURCE_DIR}/src/qtgui/armwidget.ui
${PROJECT_SOURCE_DIR}/src/qtgui/gaussianmapwidget.ui ${PROJECT_SOURCE_DIR}/src/qtgui/gaussianmapwindow.ui ${PROJECT_SOURCE_DIR}/src/qtgui/streamviewerwindow.ui ${PROJECT_SOURCE_DIR}/src/qtgui/discrepancywindow.ui)
qt5_wrap_cpp(EinQtLib_hdr_moc ${EinQtLib_hdr})
qt5_wrap_ui (EinQtLib_ui_moc ${EinQtLib_ui})
include_directories (${PROJECT_SOURCE_DIR}/src)
include_directories (${PROJECT_BINARY_DIR})
add_library (EinQtLib SHARED
${EinQtLib_src}
${EinQtLib_hdr_moc}
${EinQtLib_ui_moc}
)
add_dependencies(EinQtLib ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ein_generate_messages_cpp)
add_executable(ein src/ein.cpp src/ein_words.cpp src/config.cpp
src/ein_render.cpp src/ein_movement.cpp src/ein_servo.cpp src/ein_vision_cycle.cpp src/ein_scanning.cpp src/ein_misc.cpp src/ein_pick_place.cpp
src/ein_stream.cpp src/camera.cpp
src/word.cpp src/gaussian_map.cpp src/gaussian_map_words.cpp src/faces.cpp src/eePose.cpp src/eigen_util.cpp src/ein_util.cpp
src/opencl/ein_opencl.cpp
src/slu/math2d.cpp src/slu/gsl_utilities.cpp src/base64.cpp src/compress.cpp
src/distributions.c src/randomkit.c src/cephes/airy.c src/cephes/fdtr.c src/cephes/kn.c src/cephes/scipy_iv.c
src/cephes/bdtr.c src/cephes/fresnl.c src/cephes/kolmogorov.c src/cephes/setprec.c
src/cephes/beta.c src/cephes/gamma.c src/cephes/mmmpy.c src/cephes/shichi.c
src/cephes/btdtr.c src/cephes/gdtr.c src/cephes/mtherr.c src/cephes/sici.c
src/cephes/cbrt.c src/cephes/gels.c src/cephes/mtransp.c src/cephes/simpsn.c
src/cephes/chbevl.c src/cephes/hyp2f1.c src/cephes/mvmpy.c src/cephes/simq.c
src/cephes/chdtr.c src/cephes/hyperg.c src/cephes/nbdtr.c src/cephes/sincos.c
src/cephes/const.c src/cephes/i0.c src/cephes/ndtr.c src/cephes/sindg.c
src/cephes/cpmul.c src/cephes/i1.c src/cephes/ndtri.c src/cephes/spence.c
src/cephes/dawsn.c src/cephes/igam.c src/cephes/pdtr.c src/cephes/stdtr.c
src/cephes/ellie.c src/cephes/igami.c src/cephes/polevl.c src/cephes/struve.c
src/cephes/ellik.c src/cephes/incbet.c src/cephes/polmisc.c src/cephes/tandg.c
src/cephes/ellpe.c src/cephes/incbi.c src/cephes/polrt.c src/cephes/tukey.c
src/cephes/ellpj.c src/cephes/j0.c src/cephes/polyn.c src/cephes/unity.c
src/cephes/ellpk.c src/cephes/j1.c src/cephes/powi.c src/cephes/yn.c
src/cephes/exp10.c src/cephes/jv.c src/cephes/psi.c src/cephes/zeta.c
src/cephes/exp2.c src/cephes/k0.c src/cephes/rgamma.c src/cephes/zetac.c
src/cephes/expn.c src/cephes/k1.c src/cephes/round.c
)
target_link_libraries(ein
${catkin_LIBRARIES}
${OpenCV_LIBS}
${GSL_LIBRARIES}
${LAPACK_LIBRARIES}
${ZLIB_LIBRARIES}
EinQtLib
)
add_dependencies(ein ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ein_generate_messages_cpp)
qt5_use_modules(EinQtLib Core Gui Widgets Test OpenGL)
if (OPENGL_FOUND AND GLEW_FOUND AND GLUT_FOUND AND OpenCL_FOUND)
MESSAGE("Building openCL with hardware acceleration.")
include_directories (${PROJECT_SOURCE_DIR}/src/opencl/oclNbody/inc/)
add_definitions(-DUSE_OPENCL)
add_library(EinOpenCLLib SHARED
src/opencl/oclNbody/src/cmd_arg_reader.cpp
src/opencl/oclNbody/src/oclBodySystemCpu.cpp
src/opencl/oclNbody/src/oclBodySystemOpencl.cpp
src/opencl/oclNbody/src/oclBodySystemOpenclLaunch.cpp
src/opencl/oclNbody/src/oclNbody.cpp
src/opencl/oclNbody/src/oclNbodyGold.cpp
src/opencl/oclNbody/src/oclRenderParticles.cpp
src/opencl/oclNbody/src/oclUtils.cpp
src/opencl/oclNbody/src/param.cpp
src/opencl/oclNbody/src/paramgl.cpp
src/opencl/oclNbody/src/shrUtils.cpp)
target_link_libraries(EinOpenCLLib
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
${GLUT_LIBRARIES}
${OpenCL_LIBRARY}
EinQtLib
)
add_executable(nbody
src/opencl/oclNbody/src/cmd_arg_reader.cpp
src/opencl/oclNbody/src/oclBodySystemCpu.cpp
src/opencl/oclNbody/src/oclBodySystemOpencl.cpp
src/opencl/oclNbody/src/oclBodySystemOpenclLaunch.cpp
src/opencl/oclNbody/src/oclNbody.cpp
src/opencl/oclNbody/src/oclNbodyMain.cpp
src/opencl/oclNbody/src/oclNbodyGold.cpp
src/opencl/oclNbody/src/oclRenderParticles.cpp
src/opencl/oclNbody/src/oclUtils.cpp
src/opencl/oclNbody/src/param.cpp
src/opencl/oclNbody/src/paramgl.cpp
src/opencl/oclNbody/src/shrUtils.cpp)
target_link_libraries(nbody
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
${GLUT_LIBRARIES}
${OpenCL_LIBRARY}
)
target_link_libraries(ein EinOpenCLLib)
else()
MESSAGE("Not building openCL with hardware accelleration.")
endif()
find_package(catkin COMPONENTS baxter_core_msgs)
find_package(catkin COMPONENTS pidrone_pkg)
find_package(catkin COMPONENTS kinova_msgs)
find_package(catkin COMPONENTS movo_msgs)
find_package(catkin COMPONENTS iiwa_msgs)
# you must pick one robot.
if (baxter_core_msgs_FOUND)
MESSAGE("Building Baxter.")
add_definitions(-DUSE_ROBOT_BAXTER)
find_package(catkin REQUIRED COMPONENTS kdl_parser kdl_conversions)
string(REPLACE "." "_" happy_version ${baxter_core_msgs_VERSION} )
add_definitions(-DRETHINK_SDK_${happy_version})
add_library(EinBaxter SHARED
src/baxter/ein_baxter.cpp
src/baxter/ein_face_animation.cpp
src/baxter/ikfast/ikfast_wrapper_left.cpp
src/baxter/ikfast/ikfast_wrapper_right.cpp
src/baxter/ein_ik.cpp
)
target_link_libraries(EinBaxter
${catkin_LIBRARIES}
${OpenCV_LIBS}
${LAPACK_LIBRARIES}
)
target_link_libraries(ein EinBaxter)
elseif (pidrone_pkg_FOUND)
MESSAGE("Building Pidrone")
add_definitions(-DUSE_ROBOT_PIDRONE)
add_library(EinPidrone SHARED
src/pidrone/ein_pidrone.cpp
)
target_link_libraries(ein EinPidrone)
elseif (movo_msgs_FOUND)
MESSAGE("Building movo")
find_package(catkin REQUIRED COMPONENTS
moveit_core
moveit_ros_planning
moveit_ros_planning_interface
)
add_definitions(-DUSE_ROBOT_MOVO)
add_library(EinMovo SHARED
src/movo/ein_movo.cpp
)
target_link_libraries(ein EinMovo
${catkin_LIBRARIES}
)
add_dependencies(EinMovo ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
elseif (kinova_msgs_FOUND)
MESSAGE("Building jaco")
add_definitions(-DUSE_ROBOT_JACO)
add_library(EinJaco SHARED
src/jaco/ein_jaco.cpp
)
target_link_libraries(ein EinJaco)
elseif (iiwa_msgs_FOUND)
MESSAGE("Building Kuka")
find_package(catkin REQUIRED COMPONENTS
moveit_core
moveit_ros_planning
moveit_ros_planning_interface
)
add_definitions(-DUSE_ROBOT_KUKA)
add_library(EinKuka SHARED
src/kuka/ein_kuka.cpp
)
target_link_libraries(ein EinKuka
${catkin_LIBRARIES}
)
else()
MESSAGE("Building Aibo")
add_definitions(-DUSE_ROBOT_AIBO)
add_library(EinAibo SHARED
src/aibo/ein_aibo.cpp
src/aibo/ein_aibo_reactive.cpp
)
add_dependencies(EinAibo ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
qt5_use_modules(EinAibo Core Gui Widgets OpenGL)
target_link_libraries(EinAibo
${catkin_LIBRARIES}
${OpenCV_LIBS}
)
target_link_libraries(ein EinAibo)
endif()