-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
112 lines (94 loc) · 3.21 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(camlidar)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
find_package(G2O REQUIRED)
find_package(OpenCV 3 REQUIRED)
find_package(GTSAM REQUIRED)
find_package(SuiteSparse REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(PCL 1.8 REQUIRED)
find_package(X11 REQUIRED)
find_package(Boost REQUIRED COMPONENTS system serialization system filesystem thread program_options date_time regex timer chrono)
# Try to compile with c++11
# http://stackoverflow.com/a/25836953
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
file(GLOB_RECURSE thirdparty_sources thirdparty/yaml-cpp/*.cpp)
set(sources_factor
src/factor/*.cpp)
set(sources_dataprocess
src/dataprocess/*.cpp)
INCLUDE_DIRECTORIES(${CHOLMOD_INCLUDE_DIR}
${CSPARSE_INCLUDE_DIR}
${OpenCV_INCLUDE_DIRS}
${G2O_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
${X11_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${GTSAM_INCLUDE_DIR}
${PCL_INCLUDE_DIRS}
thirdparty
src
include)
ADD_EXECUTABLE( main_camlidar
src/main_camlidar.cpp src/dataprocess/initData.h src/dataprocess/initData.cpp src/dataprocess/imgRect.h src/dataprocess/imgRect.cpp src/dataprocess/pclProc.cpp src/dataprocess/pclProc.h)
TARGET_LINK_LIBRARIES( main_camlidar
gtsam
tbb
tbbmalloc
X11
GL
${PCL_LIBRARIES}
${GTSAM_LIBS}
${OpenCV_LIBS}
${G2O_LIBRARIES}
${Boost_LIBRARIES}
csparse
cxsparse)
ADD_EXECUTABLE( imgrect_zjudata
src/imgrect_zjudata.cpp )
TARGET_LINK_LIBRARIES( imgrect_zjudata
${OpenCV_LIBS}
${G2O_LIBRARIES}
${Boost_LIBRARIES}
csparse
cxsparse)
ADD_EXECUTABLE( imgrect_vi
src/imgrect_vi.cpp)
TARGET_LINK_LIBRARIES( imgrect_vi
${OpenCV_LIBS}
${G2O_LIBRARIES}
${Boost_LIBRARIES}
csparse
cxsparse)
ADD_EXECUTABLE( imgrect_3p
src/imgrect_3p.cpp)
TARGET_LINK_LIBRARIES( imgrect_3p
${OpenCV_LIBS}
${G2O_LIBRARIES}
${Boost_LIBRARIES}
csparse
cxsparse)
ADD_EXECUTABLE( main_gtsam
src/main_gtsam.cpp)
TARGET_LINK_LIBRARIES( main_gtsam
gtsam
tbb
tbbmalloc
X11
GL
${PCL_LIBRARIES}
${GTSAM_LIBS}
${OpenCV_LIBS}
${G2O_LIBRARIES}
${Boost_LIBRARIES}
csparse
cxsparse)