-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathCMakeLists.txt
84 lines (66 loc) · 2.73 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
PROJECT(ppfplane)
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/" ${CMAKE_MODULE_PATH})
# ROOTs
SET(EIGEN_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/eigen")
SET(CERES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/build-ceres-solver/")
SET(PANGOLIN_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/build-Pangolin/src")
########## INCLUDED LIBRARIES ##########
# Eigen
SET(EIGEN_INCLUDE_DIR_HINTS ${EIGEN_ROOT})
FIND_PACKAGE(Eigen3 3.3.4 REQUIRED)
#INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${EIGEN_ROOT})
MESSAGE(STATUS "Found Eigen headers in: ${EIGEN3_INCLUDE_DIR}")
# Ceres Solver
FIND_PACKAGE(Ceres REQUIRED HINTS "${CERES_ROOT}")
INCLUDE_DIRECTORIES(${CERES_INCLUDE_DIRS})
MESSAGE(STATUS "Found Ceres headers in: ${CERES_INCLUDE_DIRS}")
# Pangolin viewer
SET(Pangolin_DIR ${PANGOLIN_ROOT})
FIND_PACKAGE(Pangolin REQUIRED)
INCLUDE_DIRECTORIES(${Pangolin_INCLUDE_DIR})
MESSAGE(STATUS "Found Pangolin headers in: ${Pangolin_INCLUDE_DIR}")
# Sophus
INCLUDE_DIRECTORIES( 3rdParty/Sophus/ )
# CLI, command line parser
INCLUDE_DIRECTORIES( 3rdParty/CLI11/include/ )
# nanoflann
INCLUDE_DIRECTORIES( 3rdParty/nanoflann/ )
# tinyply
INCLUDE_DIRECTORIES( 3rdParty/tinyply/ )
ADD_LIBRARY( tinyply ../3rdParty/tinyply/tinyply/tinyply.cpp )
TARGET_COMPILE_OPTIONS( tinyply PRIVATE -std=c++11 )
########## CUSTOM LIBRARIES ##########
INCLUDE_DIRECTORIES( include/ )
## visualize OpenCV point cloud
SET( LIB_NAME vis_lib )
ADD_LIBRARY( ${LIB_NAME} ../include/visualize/pcshow.cpp
../include/visualize/pcshow_lines.cpp
../include/visualize/pcshow_corners.cpp
)
TARGET_LINK_LIBRARIES( ${LIB_NAME} ${Pangolin_LIBRARIES})
TARGET_COMPILE_OPTIONS( ${LIB_NAME} PRIVATE -std=c++11 )
## graph
SET( LIB_NAME graph_lib )
ADD_LIBRARY( ${LIB_NAME} ../include/graph/PlaneGraph.cpp
../include/graph/ParallelPlaneGraph_filtering.cpp
../include/graph/ParallelPlaneGraph_clustering.cpp
../include/graph/ParallelPlaneGraph_optimization.cpp
)
TARGET_LINK_LIBRARIES( ${LIB_NAME} ${CERES_LIBRARIES})
TARGET_COMPILE_OPTIONS( ${LIB_NAME} PRIVATE -std=c++11 )
## corners
SET( LIB_NAME corner_lib )
ADD_LIBRARY( ${LIB_NAME} ../include/corners/Corner.cpp
)
TARGET_LINK_LIBRARIES( ${LIB_NAME} ${CERES_LIBRARIES})
TARGET_COMPILE_OPTIONS( ${LIB_NAME} PRIVATE -std=c++11 )
## PPF
SET( LIB_NAME ppf_lib )
ADD_LIBRARY( ${LIB_NAME} ../include/PPF/PairDetector.cpp
)
TARGET_COMPILE_OPTIONS( ${LIB_NAME} PRIVATE -std=c++11 )
########## DIRECTORIES ##########
ADD_SUBDIRECTORY(ply_detect_refine)
ADD_SUBDIRECTORY(ply_corners)