-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
161 lines (137 loc) · 5.67 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
cmake_minimum_required(VERSION 3.9.6)
project(GOT)
# Build Options
option(SHOW_PATH "Show path of libs and headers" ON)
set(OpenCV_DIR "/home/aljosa/local/share/OpenCV" CACHE PATH "Path to local OpenCV e.g. USER/local/share/OpenCV")
set(BOOST_ROOT "/home/aljosa/local/lib" CACHE PATH "Boost root dir")
# Configuration
# Compiler Flags
set(CMAKE_CXX_COMPILER_FLAGS "${CMAKE_CXX_COMPILER_FLAGS} -Wall") # Enables all compiler warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # Generate position independent code
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -DBOOST_MATH_DISABLE_FLOAT128") # Enable c++17
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse3") # Forcing SSE vectorization instructions may cause segmentfault
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
# Here we set *_LIBS, *_INCLUDE_DIRS, etc
find_package(OpenCV REQUIRED COMPONENTS core highgui imgproc calib3d)
find_package(PCL 1.9.0 REQUIRED COMPONENTS common io visualization filters sample_consensus segmentation kdtree)
link_directories(${PCL_LIBRARY_DIRS})
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.55 COMPONENTS program_options thread system signals REQUIRED)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIR})
message(STATUS "Boost found!" ${Boost_LIBRARIES})
endif()
include_directories(include ${PROJECT_SOURCE_DIR} ${OpenCV_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS})
# Include own files
file(GLOB PROJ_SRC_FILES ${CMAKE_SOURCE_DIR}/src/*.cpp)
include_directories(${CMAKE_SOURCE_DIR}/src)
file(GLOB EXTERNAL_SRC_FILES ${CMAKE_SOURCE_DIR}/src/external/*.cpp)
set(EXTERNAL_SRC_DIR ${CMAKE_SOURCE_DIR}/src/external)
include_directories(${EXTERNAL_SRC_DIR})
file(GLOB SUN_UTILS_SRC_FILES ${CMAKE_SOURCE_DIR}/src/sun_utils/*.cpp)
set(SUN_UTILS_SRC_DIR ${CMAKE_SOURCE_DIR}/src/sun_utils)
include_directories(${SUN_UTILS_SRC_DIR})
file(GLOB CAMOT_SRC_FILES ${CMAKE_SOURCE_DIR}/src/CAMOT/*.cpp)
set(CAMOT_SRC_DIR ${CMAKE_SOURCE_DIR}/src/CAMOT)
include_directories(${CAMOT})
find_package(OpenMP)
if (OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
message(STATUS "Use OpenMP")
endif()
# Libraries
add_library (connected_components
src/connected_components/CC.cpp
src/connected_components/CPoint.cpp
include/connected_components/CC.h
include/connected_components/CPoint.h
)
add_library (viso2
src/libviso2/matrix.cpp
src/libviso2/viso.cpp
src/libviso2/viso_mono.cpp
src/libviso2/viso_stereo.cpp
src/libviso2/matcher.cpp
src/libviso2/reconstruction.cpp
src/libviso2/triangle.cpp
src/libviso2/filter.cpp
include/libviso2/viso.h
include/libviso2/viso_mono.h
include/libviso2/viso_stereo.h
include/libviso2/matcher.h
include/libviso2/reconstruction.h
include/libviso2/triangle.h
include/libviso2/filter.h
)
add_library (elas
src/libelas/matrix.cpp
src/libelas/triangle.cpp
src/libelas/filter.cpp
src/libelas/elas.cpp
src/libelas/descriptor.cpp
include/libelas/elas.h
include/libelas/image.h
include/libelas/timer.h
include/libelas/matrix.h
include/libelas/triangle.h
include/libelas/filter.h
include/libelas/descriptor.h
)
add_library (tracking
src/tracking/data_queue.cpp
src/tracking/observation.cpp
src/tracking/multi_object_tracker_base.cpp
src/tracking/hypothesis.cpp
src/tracking/kalman_filter.cpp
src/tracking/extended_kalman_filter.cpp
src/tracking/visualization.cpp
src/tracking/qpbo.cpp
include/tracking/data_queue.h
include/tracking/observation.h
include/tracking/multi_object_tracker_base.h
include/tracking/hypothesis.h
include/tracking/kalman_filter.h
include/tracking/extended_kalman_filter.h
include/tracking/visualization.h
include/tracking/qpbo.h
include/tracking/dynamics_handler.h
)
add_library (scene_segmentation
src/scene_segmentation/ground_histogram.cpp
src/scene_segmentation/object_proposal.cpp
src/scene_segmentation/scene_segmentation.cpp
src/scene_segmentation/utils_segmentation.cpp
src/scene_segmentation/json_prop_tools.cpp
src/scene_segmentation/scene_filtering.cpp
include/scene_segmentation/ground_histogram.h
include/scene_segmentation/object_proposal.h
include/scene_segmentation/scene_segmentation.h
include/scene_segmentation/utils_segmentation.h
include/scene_segmentation/segmentation_visualization.h
include/scene_segmentation/parameters_gop3D.h
include/scene_segmentation/json_prop_tools.h
include/scene_segmentation/scene_filtering.h)
target_link_libraries(connected_components)
target_link_libraries(elas)
target_link_libraries(viso2)
target_link_libraries(scene_segmentation pthread)
target_link_libraries(tracking viso2)
# Subdirectories
# Add subfolder that also contain CMakeLists.txt
add_subdirectory(apps)
# Debug infos
if(SHOW_PATH)
message(STATUS "Boost_LIBRARIES: " ${Boost_LIBRARIES})
message(STATUS ${OpenCV_LIBS})
message(STATUS "Project Source Dirs: " ${PROJECT_SOURCE_DIR})
message(STATUS "OpenCV Include Dirs: " ${OpenCV_INCLUDE_DIRS})
message(STATUS "PCL Include Dirs: " ${PCL_INCLUDE_DIRS})
message(STATUS "")
endif()