forked from LRMPUT/PUTSLAM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
685 lines (569 loc) · 28.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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
# cmake requirements
cmake_minimum_required(VERSION 2.8)
# Build options have to be before PROJECT(...)
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE PATH "Configuration types")
#SET(CMAKE_BUILD_TYPE "Release" CACHE PATH "Current build configuration")
SET(CMAKE_BUILD_TYPE "Debug")
# PUTSLAM Project configuration
PROJECT(PUTSLAM)
SET(CMAKE_CXX_FLAGS "-std=c++11 -pthread")
# Folders
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
# Settings
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include/Defs")
# core libraries
option(BUILD_PUTSLAM "Build PUT SLAM libraries" ON)
option(BUILD_PUTSLAM_DEFS "Build PUTSLAM Defs library" ON)
mark_as_advanced(BUILD_PUTSLAM_DEFS)
option(BUILD_PUTSLAM_UTILITIES "Build PUTSLAM Utilities library" ON)
mark_as_advanced(BUILD_PUTSLAM_UTILITIES)
option(BUILD_PUTSLAM_GRABBER "Build PUTSLAM Grabber library" ON)
mark_as_advanced(BUILD_PUTSLAM_GRABBER)
option(BUILD_PUTSLAM_GRABBER_PTGREY "Build PUTSLAM Grabber PointGrey library" ON)
mark_as_advanced(BUILD_PUTSLAM_GRABBER_PTGREY)
option(BUILD_PUTSLAM_TRACKER "Build PUTSLAM Tracker library" ON)
mark_as_advanced(BUILD_PUTSLAM_TRACKER)
option(BUILD_PUTSLAM_LDB "Build PUTSLAM LDB library" ON)
mark_as_advanced(BUILD_PUTSLAM_LDB)
option(BUILD_PUTSLAM_RGBD "Build PUTSLAM RGBD library" ON)
mark_as_advanced(BUILD_PUTSLAM_RGBD)
option(BUILD_PUTSLAM_MATCHER "Build PUTSLAM Matcher library" ON)
mark_as_advanced(BUILD_PUTSLAM_MATCHER)
option(BUILD_PUTSLAM_MOTIONMODEL "Build PUTSLAM MotionModel library" ON)
mark_as_advanced(BUILD_PUTSLAM_MOTIONMODEL)
option(BUILD_PUTSLAM_TRANSFORM_ESTIMATOR "Build PUTSLAM Transformation Estimation library" ON)
mark_as_advanced(BUILD_PUTSLAM_TRANSFORM_ESTIMATOR)
#option(BUILD_PUTSLAM_USAC "Build PUTSLAM USAC library" ON)
#mark_as_advanced(BUILD_PUTSLAM_USAC)
option(BUILD_PUTSLAM_POSE_GRAPH "Build PUTSLAM Pose Graph (local and global graph) library" ON)
mark_as_advanced(BUILD_PUTSLAM_POSE_GRAPH)
option(BUILD_PUTSLAM_MAP "Build PUTSLAM Map library" ON)
mark_as_advanced(BUILD_PUTSLAM_MAP)
option(BUILD_PUTSLAM_LOOPCLOSURE "Build PUTSLAM loop closure library" ON)
mark_as_advanced(BUILD_PUTSLAM_LOOPCLOSURE)
option(BUILD_PUTSLAM_PATCH "Build PUTSLAM Patches" ON)
mark_as_advanced(BUILD_PUTSLAM_PATCH)
option(BUILD_PUTSLAM_VISUALIZER "Build PUTSLAM Visualizer" ON)
mark_as_advanced(BUILD_PUTSLAM_VISUALIZER)
option(BUILD_PUTSLAM_DEMO_PLAYER "Build g2o player demo" ON)
mark_as_advanced(BUILD_PUTSLAM_DEMO_PLAYER)
# demos
option(BUILD_PUTSLAM_DEMO "Build PUT SLAM demonstration programs and libraries" ON)
option(BUILD_PUTSLAM_DEMO_G2O "Build g2o PUT SLAM test" ON)
mark_as_advanced(BUILD_PUTSLAM_DEMO_G2O)
option(BUILD_PUTSLAM_DEMO_BASIC "Build basic PUT SLAM test" ON)
mark_as_advanced(BUILD_PUTSLAM_DEMO_BASIC)
option(BUILD_PUTSLAM_DEMO_GRABBER "Build demo for grabber" ON)
mark_as_advanced(BUILD_PUTSLAM_DEMO_GRABBER)
option(BUILD_PUTSLAM_DEMO_KABSCH "Build demo for Kabsch" ON)
mark_as_advanced(BUILD_PUTSLAM_DEMO_KABSCH)
option(BUILD_PUTSLAM_DEMO_MAP "Build demo for features map" ON)
mark_as_advanced(BUILD_PUTSLAM_DEMO_MAP)
option(BUILD_PUTSLAM_GRAPHCONVERTER "Build g2o 2D graph to 3D graph converter" ON)
mark_as_advanced(BUILD_PUTSLAM_GRAPHCONVERTER)
option(BUILD_PUTSLAM_DEMO_VISUALIZER "Build g2o visualizer demo" ON)
mark_as_advanced(BUILD_PUTSLAM_DEMO_VISUALIZER)
#additional dependencies
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
# Add OpenCV 3 package
SET(CMAKE_PREFIX_PATH "/home/koralgoll/Libs/opencv/opencv-latest/build")
# Boost
#FIND_PACKAGE(Boost COMPONENTS system filesystem thread)
# OpenCV
FIND_PACKAGE(OpenCV 3 REQUIRED)
include_directories( ${OpenCV_INCLUDE_DIRS} )
# PCL
#FIND_PACKAGE(PCL REQUIRED)
#include_directories(${PCL_INCLUDE_DIRS})
#link_directories(${PCL_LIBRARY_DIRS})
#add_definitions(${PCL_DEFINITIONS})
#octomap library
find_package(octomap REQUIRED)
include_directories(${OCTOMAP_INCLUDE_DIRS})
link_libraries(${OCTOMAP_LIBRARIES})
#g2o library
find_package(G2O REQUIRED)
include_directories(${G2O_INCLUDE_DIR})
link_directories(${G2O_LIBRARY_DIRS})
#CSparse library
FIND_PACKAGE(CSparse)
include_directories(${LIBCSPARSE_INCLUDE_DIR})
link_directories(${LIBCSPARSE_LIBRARY})
#Eigen
#set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/3rdParty/Eigen)
#find_package(Eigen3 REQUIRED)
include_directories("/home/koralgoll/CodeArea52/Drone landing area detection/SLAM-algorithm/3rdParty")
#add_definitions(-Wno-deprecated -DEIGEN_DONT_VECTORIZE -DEIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT)
#QGLViewer library
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
FIND_PACKAGE(OpenGL)
include_directories(${OPENGL_INCLUDE_DIR})
link_directories(${OPENGL_LIBRARY})
#QGLViewer library
FIND_PACKAGE(QGLViewer)
include_directories(${QGLVIEWER_INCLUDE_DIR})
include_directories(${QT_INCLUDES})
link_directories(${QGLVIEWER_LIBRARY})
# Executable output directory
SET(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build/bin${OUTPUT_DIRECTORY_POSTFIX} CACHE PATH "Executable output directory")
mark_as_advanced(RUNTIME_OUTPUT_DIRECTORY)
# Dynamic library output directory
SET(LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build/bin${OUTPUT_DIRECTORY_POSTFIX} CACHE PATH "Dynamic library output directory")
mark_as_advanced(LIBRARY_OUTPUT_DIRECTORY)
# Static library output directory
SET(ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build/lib${OUTPUT_DIRECTORY_POSTFIX} CACHE PATH "Static library output directory")
mark_as_advanced(ARCHIVE_OUTPUT_DIRECTORY)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${RUNTIME_OUTPUT_DIRECTORY})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_DIRECTORY})
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ARCHIVE_OUTPUT_DIRECTORY})
foreach(CONFIGURATION_TYPE ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${CONFIGURATION_TYPE} CONFIGURATION_TYPE)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONFIGURATION_TYPE} ${RUNTIME_OUTPUT_DIRECTORY})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONFIGURATION_TYPE} ${LIBRARY_OUTPUT_DIRECTORY})
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONFIGURATION_TYPE} ${ARCHIVE_OUTPUT_DIRECTORY})
endforeach(CONFIGURATION_TYPE CMAKE_CONFIGURATION_TYPES)
if (MSVC)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
endif()
###############################################################################
#
# PUTSLAM tinyXML2 library
#
###############################################################################
add_library(tinyxml2 SHARED ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/tinyXML/tinyxml2.h ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/tinyXML/tinyxml2.cpp)
###############################################################################
#
# PUTSLAM defs library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_DEFS)
file(GLOB DEFS_HEADERS
"${CMAKE_SOURCE_DIR}/include/Defs/putslam_defs.h"
)
ADD_LIBRARY(PUTSLAM_DEFS STATIC ${DEFS_HEADERS})
set_target_properties(PUTSLAM_DEFS PROPERTIES LINKER_LANGUAGE CXX)
# INSTALL(TARGETS PUTSLAMDefs RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${DEFS_HEADERS} DESTINATION include/Defs/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_DEFS)
###############################################################################
#
# PUTSLAM Utilities library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_UTILITIES)
file(GLOB UTILITIES_SOURCES
"${CMAKE_SOURCE_DIR}/src/Utilities/*.cpp"
)
file(GLOB UTILITIES_HEADERS
"${CMAKE_SOURCE_DIR}/include/Utilities/*.h"
)
ADD_LIBRARY(Utilities STATIC ${UTILITIES_SOURCES} ${UTILITIES_HEADERS})
INSTALL(TARGETS Utilities RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${TRACKER_HEADERS} DESTINATION include/putslam/Utilities/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_UTILITIES)
###############################################################################
#
# PUTSLAM Grabber library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_GRABBER)
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/3rdParty/OpenNI2/Include")
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_GRABBER AND BUILD_PUTSLAM_GRABBER_PTGREY)
add_definitions(-DWITH_PTGREY)
INCLUDE_DIRECTORIES("/usr/include/flycapture")
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_GRABBER AND BUILD_PUTSLAM_GRABBER_PTGREY)
LINK_DIRECTORIES("${CMAKE_SOURCE_DIR}/3rdParty/OpenNI2/Lib")
file(GLOB GRABBER_SOURCES
"${CMAKE_SOURCE_DIR}/src/Grabber/calibration.cpp"
"${CMAKE_SOURCE_DIR}/src/Grabber/depthSensorModel.cpp"
"${CMAKE_SOURCE_DIR}/src/Grabber/kinectGrabber.cpp"
"${CMAKE_SOURCE_DIR}/src/Grabber/fileGrabber.cpp"
#if(BUILD_PUTSLAM AND BUILD_PUTSLAM_GRABBER AND BUILD_PUTSLAM_GRABBER_PTGREY)
"${CMAKE_SOURCE_DIR}/src/Grabber/ptgreyGrabber.cpp"
#endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_GRABBER AND BUILD_PUTSLAM_GRABBER_PTGREY)
"${CMAKE_SOURCE_DIR}/src/Grabber/templateGrabber.cpp"
"${CMAKE_SOURCE_DIR}/src/Grabber/xtionGrabber.cpp"
)
file(GLOB GRABBER_HEADERS
"${CMAKE_SOURCE_DIR}/include/Grabber/grabber.h"
"${CMAKE_SOURCE_DIR}/include/Grabber/calibration.h"
"${CMAKE_SOURCE_DIR}/include/Grabber/depthSensorModel.h"
"${CMAKE_SOURCE_DIR}/include/Grabber/kinectGrabber.h"
"${CMAKE_SOURCE_DIR}/include/Grabber/fileGrabber.h"
#if(BUILD_PUTSLAM AND BUILD_PUTSLAM_GRABBER AND BUILD_PUTSLAM_GRABBER_PTGREY)
"${CMAKE_SOURCE_DIR}/include/Grabber/ptgreyGrabber.h"
#endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_GRABBER AND BUILD_PUTSLAM_GRABBER_PTGREY)
"${CMAKE_SOURCE_DIR}/include/Grabber/templateGrabber.h"
"${CMAKE_SOURCE_DIR}/include/Grabber/xtionGrabber.h"
)
ADD_LIBRARY(Grabber STATIC ${GRABBER_SOURCES} ${GRABBER_HEADERS})
TARGET_LINK_LIBRARIES(Grabber OpenNI2 ${OpenCV_LIBS})
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_GRABBER AND BUILD_PUTSLAM_GRABBER_PTGREY)
TARGET_LINK_LIBRARIES(Grabber OpenNI2 ${OpenCV_LIBS} flycapture-c flycapture)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_GRABBER AND BUILD_PUTSLAM_GRABBER_PTGREY)
file(INSTALL "${CMAKE_SOURCE_DIR}/3rdParty/OpenNI2/Lib/" DESTINATION bin)
INSTALL(TARGETS Grabber RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${GRABBER_HEADERS} GRABBERKINECT_HEADERS DESTINATION include/putslam/Grabber/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_GRABBER)
###############################################################################
#
# PUTSLAM Tracker library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_TRACKER)
file(GLOB TRACKER_SOURCES
"${CMAKE_SOURCE_DIR}/src/Tracker/*.cpp"
)
file(GLOB TRACKER_HEADERS
"${CMAKE_SOURCE_DIR}/include/Tracker/*.h"
)
ADD_LIBRARY(Tracker STATIC ${TRACKER_SOURCES} ${TRACKER_HEADERS})
INSTALL(TARGETS Tracker RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${TRACKER_HEADERS} DESTINATION include/putslam/Tracker/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_TRACKER)
###############################################################################
#
# PUTSLAM Transformation Estimation library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_TRANSFORM_ESTIMATOR)
file(GLOB TRANSFORM_ESTIMATOR_SOURCES
"${CMAKE_SOURCE_DIR}/src/TransformEst/*.cpp"
)
file(GLOB TRANSFORM_ESTIMATOR_HEADERS
"${CMAKE_SOURCE_DIR}/include/TransformEst/*.h"
)
ADD_LIBRARY(TransformEst STATIC ${TRANSFORM_ESTIMATOR_SOURCES} ${TRANSFORM_ESTIMATOR_HEADERS})
TARGET_LINK_LIBRARIES(TransformEst RGBD)
INSTALL(TARGETS TransformEst RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${TRANSFORM_ESTIMATOR_HEADERS} DESTINATION include/putslam/TransformEst/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_TRANSFORM_ESTIMATOR)
###############################################################################
#
# PUTSLAM USAC library
#
###############################################################################
#if(BUILD_PUTSLAM AND BUILD_PUTSLAM_USAC)
# file(GLOB USAC_SOURCES
# "${CMAKE_SOURCE_DIR}/src/USAC/*.cpp"
# )
# file(GLOB USAC_HEADERS
# "${CMAKE_SOURCE_DIR}/include/USAC/*.h"
# )
#
# ADD_LIBRARY(USAC STATIC ${USAC_SOURCES} ${USAC_HEADERS})
# TARGET_LINK_LIBRARIES(USAC RGBD)
# INSTALL(TARGETS USAC RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
# INSTALL(FILES ${USAC_HEADERS} DESTINATION include/putslam/USAC/)
#endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_USAC)
###############################################################################
#
# PUTSLAM LDB library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_LDB)
file(GLOB LDB_SOURCES
"${CMAKE_SOURCE_DIR}/src/LDB/*.cpp"
)
file(GLOB LDB_HEADERS
"${CMAKE_SOURCE_DIR}/include/LDB/*.h"
)
ADD_LIBRARY(LDB STATIC ${LDB_SOURCES} ${LDB_HEADERS})
INSTALL(TARGETS LDB RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${LDB_HEADERS} DESTINATION include/putslam/LDB/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_LDB)
###############################################################################
#
# PUTSLAM RGBD library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_RGBD)
file(GLOB RGBD_SOURCES
"${CMAKE_SOURCE_DIR}/src/RGBD/*.cpp"
)
file(GLOB RGBD_HEADERS
"${CMAKE_SOURCE_DIR}/include/RGBD/*.h"
)
ADD_LIBRARY(RGBD STATIC ${RGBD_SOURCES} ${RGBD_HEADERS})
INSTALL(TARGETS RGBD RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${RGBD_HEADERS} DESTINATION include/putslam/RGBD/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_RGBD)
###############################################################################
#
# PUTSLAM Matcher library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_MATCHER)
file(GLOB MATCHER_SOURCES
"${CMAKE_SOURCE_DIR}/src/Matcher/*.cpp"
)
file(GLOB MATCHER_HEADERS
"${CMAKE_SOURCE_DIR}/include/Matcher/*.h"
)
ADD_LIBRARY(Matcher STATIC ${MATCHER_SOURCES} ${MATCHER_HEADERS})
TARGET_LINK_LIBRARIES(Matcher ${OpenCV_LIBS} LDB RGBD TransformEst)
INSTALL(TARGETS Matcher RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${MATCHER_HEADERS} DESTINATION include/putslam/Matcher/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_MATCHER)
###############################################################################
#
# PUTSLAM MotionModel library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_MOTIONMODEL)
file(GLOB MOTIONMODDEL_SOURCES
"${CMAKE_SOURCE_DIR}/src/MotionModel/*.cpp"
)
file(GLOB MOTIONMODDEL_HEADERS
"${CMAKE_SOURCE_DIR}/include/MotionModel/*.h"
)
ADD_LIBRARY(MotionModel STATIC ${MOTIONMODDEL_SOURCES} ${MOTIONMODDEL_HEADERS})
INSTALL(TARGETS MotionModel RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${MOTIONMODDEL_HEADERS} DESTINATION include/putslam/MotionModel/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_MOTIONMODEL)
###############################################################################
#
# PUTSLAM Pose Graph (local SLAM) library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_POSE_GRAPH)
file(GLOB POSE_GRAPH_SOURCES
"${CMAKE_SOURCE_DIR}/src/PoseGraph/*.cpp"
)
file(GLOB POSE_GRAPH_HEADERS
"${CMAKE_SOURCE_DIR}/include/PoseGraph/*.h"
)
ADD_LIBRARY(PoseGraph STATIC ${POSE_GRAPH_SOURCES} ${POSE_GRAPH_HEADERS})
TARGET_LINK_LIBRARIES(PoseGraph csparse g2o_types_slam2d g2o_types_slam3d g2o_csparse_extension g2o_stuff g2o_core g2o_solver_csparse)
INSTALL(TARGETS PoseGraph RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${POSE_GRAPH_HEADERS} DESTINATION include/putslam/PoseGraph/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_POSE_GRAPH)
###############################################################################
#
# PUTSLAM LoopClosure library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_LOOPCLOSURE)
file(GLOB LOOPCLOSURE_SOURCES
"${CMAKE_SOURCE_DIR}/src/LoopClosure/*.cpp"
)
file(GLOB LOOPCLOSURE_HEADERS
"${CMAKE_SOURCE_DIR}/include/LoopClosure/*.h"
)
ADD_LIBRARY(LoopClosure STATIC ${LOOPCLOSURE_SOURCES} ${LOOPCLOSURE_HEADERS})
TARGET_LINK_LIBRARIES(LoopClosure Utilities Matcher RGBD)
INSTALL(TARGETS LoopClosure RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${LOOPCLOSURE_HEADERS} DESTINATION include/putslam/LoopClosure/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_LOOPCLOSURE)
###############################################################################
#
# PUTSLAM Map library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_MAP)
file(GLOB MAP_SOURCES
"${CMAKE_SOURCE_DIR}/src/Map/*.cpp"
)
file(GLOB MAP_HEADERS
"${CMAKE_SOURCE_DIR}/include/Map/*.h"
)
ADD_LIBRARY(Map STATIC ${MAP_SOURCES} ${MAP_HEADERS})
TARGET_LINK_LIBRARIES(Map PoseGraph Grabber Utilities Matcher TransformEst RGBD LoopClosure)
INSTALL(TARGETS Map RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${MAP_HEADERS} DESTINATION include/putslam/Map/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_MAP)
###############################################################################
#
# PUTSLAM Visualizer library
#
###############################################################################
if(BUILD_PUTSLAM AND BUILD_PUTSLAM_VISUALIZER)
file(GLOB VISUALIZER_SOURCES
"${CMAKE_SOURCE_DIR}/src/Visualizer/*.cpp"
)
file(GLOB VISUALIZER_HEADERS
"${CMAKE_SOURCE_DIR}/include/Visualizer/*.h"
)
ADD_LIBRARY(Visualizer STATIC ${VISUALIZER_SOURCES} ${VISUALIZER_HEADERS})
TARGET_LINK_LIBRARIES(Visualizer tinyxml2 Map ${QGLVIEWER_LIBRARY} ${QT_LIBRARIES} QtCore QtXml QtOpenGL QtGui ${OPENGL_LIBRARY})
INSTALL(TARGETS Utilities RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${VISUALIZER_HEADERS} DESTINATION include/putslam/Visualizer/)
endif(BUILD_PUTSLAM AND BUILD_PUTSLAM_VISUALIZER)
###############################################################################
#
# PUTSLAM library
#
###############################################################################
if(BUILD_PUTSLAM)
file(GLOB LIBPUTSLAM_SOURCES
"${CMAKE_SOURCE_DIR}/src/PUTSLAM/*.cpp"
)
file(GLOB LIBPUTSLAM_HEADERS
"${CMAKE_SOURCE_DIR}/include/PUTSLAM/*.h"
)
ADD_LIBRARY(LIBPUTSLAM STATIC ${LIBPUTSLAM_SOURCES} ${LIBPUTSLAM_HEADERS})
TARGET_LINK_LIBRARIES(LIBPUTSLAM tinyxml2 Map Matcher MotionModel RGBD TransformEst Utilities ${OpenCV_LIBS})
INSTALL(TARGETS Utilities RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib)
INSTALL(FILES ${LIBPUTSLAM_HEADERS} DESTINATION include/putslam/PUTSLAM/)
endif(BUILD_PUTSLAM)
###############################################################################
#
# PUTSLAM DEMO executableslanguage
#
###############################################################################
if(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_BASIC)
SET(DEMO_FILES
${PROJECT_ROOT}/resources/configGlobal.xml
)
SET(DEMO_SOURCES ./main.cpp)
ADD_EXECUTABLE(demo ${DEMO_SOURCES})
TARGET_LINK_LIBRARIES(demo tinyxml2 Grabber Tracker TransformEst ${OpenCV_LIBS} PoseGraph boost_system)
INSTALL(TARGETS demo RUNTIME DESTINATION bin)
INSTALL(FILES ${DEMO_FILES} DESTINATION bin)
endif(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_BASIC)
###############################################################################
#
# PUTSLAM DEMO matching executables
#
###############################################################################
if(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_BASIC)
SET(DEMO_FILES
${PROJECT_ROOT}/resources/configGlobal.xml
)
SET(DEMO_SOURCES ./demos/demoMatching.cpp)
ADD_EXECUTABLE(demoMatching ${DEMO_SOURCES})
TARGET_LINK_LIBRARIES(demoMatching tinyxml2 Grabber Map Matcher TransformEst LDB ${OpenCV_LIBS} PoseGraph LIBPUTSLAM boost_system)
INSTALL(TARGETS demoMatching RUNTIME DESTINATION bin)
INSTALL(FILES ${DEMO_FILES} DESTINATION bin)
endif(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_BASIC)
###############################################################################
#
# PUTSLAM DEMO g2o graph optimization executables
#
###############################################################################
if(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_G2O)
SET(DEMO_FILES
${PROJECT_ROOT}/resources/configGlobal.xml
)
SET(DEMO_SOURCES ./demos/demoG2o.cpp)
ADD_EXECUTABLE(demoG2o ${DEMO_SOURCES})
add_dependencies(demoG2o g2o)
TARGET_LINK_LIBRARIES(demoG2o tinyxml2 Grabber Tracker TransformEst ${OpenCV_LIBS} PoseGraph boost_system)
INSTALL(TARGETS demoG2o RUNTIME DESTINATION bin)
INSTALL(FILES ${DEMO_FILES} DESTINATION bin)
endif(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_G2O)
###############################################################################
#
# PUTSLAM DEMO g2o graph pruning and optimization executables
#
###############################################################################
if(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_G2O)
SET(DEMO_FILES
${PROJECT_ROOT}/resources/configGlobal.xml
)
ADD_EXECUTABLE(demoPruning ${DEMO_SOURCES})
add_dependencies(demoPruning g2o)
TARGET_LINK_LIBRARIES(demoPruning tinyxml2 Grabber Tracker TransformEst ${OpenCV_LIBS} PoseGraph Utilities boost_system)
INSTALL(TARGETS demoPruning RUNTIME DESTINATION bin)
INSTALL(FILES ${DEMO_FILES} DESTINATION bin)
endif(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_G2O)
###############################################################################
#
# PUTSLAM DEMO g2o grabber executables
#
###############################################################################
if(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_GRABBER)
SET(DEMO_FILES
${PROJECT_ROOT}/resources/configGlobal.xml
)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath ./")
SET(DEMO_SOURCES ./demos/demoGrabber.cpp)
ADD_EXECUTABLE(demoGrabber ${DEMO_SOURCES})
add_dependencies(demoGrabber g2o)
TARGET_LINK_LIBRARIES(demoGrabber tinyxml2 Grabber Tracker TransformEst ${OpenCV_LIBS} PoseGraph boost_system)
INSTALL(TARGETS demoGrabber RUNTIME DESTINATION bin)
INSTALL(FILES ${DEMO_FILES} DESTINATION bin)
endif(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_GRABBER)
###############################################################################
#
# PUTSLAM DEMO Kabsch
#
###############################################################################
if(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_KABSCH)
SET(DEMO_FILES
${PROJECT_ROOT}/resources/configGlobal.xml
)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath ./")
SET(DEMO_SOURCES ./demos/demoKabsch.cpp)
ADD_EXECUTABLE(demoKabsch ${DEMO_SOURCES})
add_dependencies(demoKabsch g2o)
TARGET_LINK_LIBRARIES(demoKabsch tinyxml2 Grabber Tracker TransformEst Utilities ${OpenCV_LIBS} PoseGraph boost_system)
INSTALL(TARGETS demoKabsch RUNTIME DESTINATION bin)
INSTALL(FILES ${DEMO_FILES} DESTINATION bin)
endif(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_KABSCH)
###############################################################################
#
# PUTSLAM g2o 2D graph to 3D graph converter
#
###############################################################################
if(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_GRAPHCONVERTER)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath ./")
SET(DEMO_SOURCES ./demos/graph2D2graph3D.cpp)
ADD_EXECUTABLE(graph2D2graph3D ${DEMO_SOURCES})
add_dependencies(graph2D2graph3D g2o)
TARGET_LINK_LIBRARIES(graph2D2graph3D tinyxml2 Utilities PoseGraph ${OpenCV_LIBS} boost_system)
INSTALL(TARGETS graph2D2graph3D RUNTIME DESTINATION bin)
endif(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_GRAPHCONVERTER)
###############################################################################
#
# PUTSLAM demo Features map
#
###############################################################################
if(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_MAP)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath ./")
SET(DEMO_SOURCES ./demos/demoMap.cpp)
ADD_EXECUTABLE(demoMap ${DEMO_SOURCES})
add_dependencies(demoMap g2o)
TARGET_LINK_LIBRARIES(demoMap tinyxml2 Utilities PoseGraph Map TransformEst LDB ${OpenCV_LIBS} boost_system)
INSTALL(TARGETS demoMap RUNTIME DESTINATION bin)
endif(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_MAP)
###############################################################################
#
# PUTSLAM demo patches
#
###############################################################################
if(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_PATCH)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath ./")
SET(DEMO_SOURCES ./demos/demoPatches.cpp)
ADD_EXECUTABLE(demoPatches ${DEMO_SOURCES})
add_dependencies(demoPatches g2o)
TARGET_LINK_LIBRARIES(demoPatches tinyxml2 Utilities PoseGraph Map Matcher LDB ${OpenCV_LIBS} boost_system)
INSTALL(TARGETS demoPatches RUNTIME DESTINATION bin)
endif(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_PATCH)
###############################################################################
#
# PUTSLAM demo Visualizer
#
###############################################################################
if(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_VISUALIZER)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath ./")
SET(DEMO_SOURCES ./demos/demoVisualizer.cpp)
ADD_EXECUTABLE(demoVisualizer ${DEMO_SOURCES})
# add_dependencies(demoVisualizer Map)
TARGET_LINK_LIBRARIES(demoVisualizer Visualizer tinyxml2 Map LIBPUTSLAM ${QGLVIEWER_LIBRARY} ${QT_LIBRARIES} ${OPENGL_LIBRARY} glut boost_system)
INSTALL(TARGETS demoVisualizer RUNTIME DESTINATION bin)
endif(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_VISUALIZER)
###############################################################################
#
# PUTSLAM demo Player
#
###############################################################################
if(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_PLAYER)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath ./")
SET(DEMO_SOURCES ./demos/demoPlayer.cpp)
ADD_EXECUTABLE(demoPlayer ${DEMO_SOURCES})
# add_dependencies(demoVisualizer Map)
TARGET_LINK_LIBRARIES(demoPlayer Visualizer tinyxml2 Map LIBPUTSLAM ${QGLVIEWER_LIBRARY} ${QT_LIBRARIES} ${OPENGL_LIBRARY} glut boost_system)
INSTALL(TARGETS demoPlayer RUNTIME DESTINATION bin)
endif(BUILD_PUTSLAM_DEMO AND BUILD_PUTSLAM_DEMO_PLAYER)