forked from dzunigan/zSLAM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (36 loc) · 2.56 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
PROJECT(zSLAM)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -mtune=native -march=native")
GET_FILENAME_COMPONENT(MRPT_PATHS "../MRPT/build" ABSOLUTE)
GET_FILENAME_COMPONENT(PCL_PATHS "../PCL/build" ABSOLUTE)
GET_FILENAME_COMPONENT(OpenCV_PATHS "../OpenCV/build" ABSOLUTE)
SET(MRPT_DIR ${MRPT_PATHS} CACHE PATH "Preferred config path")
SET(PCL_DIR ${PCL_PATHS} CACHE PATH "Preferred config path")
SET(OpenCV_DIR ${OpenCV_PATHS} CACHE PATH "Preferred config path")
LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
FIND_PACKAGE(MRPT REQUIRED COMPONENTS gui hwdrivers vision CONFIG PATHS ${MRPT_PATHS})
FIND_PACKAGE(PCL 1.3 REQUIRED CONFIG PATHS ${PCL_PATHS})
FIND_PACKAGE(OpenCV REQUIRED CONFIG PATHS ${OpenCV_PATHS})
FIND_PACKAGE(DBoW2 REQUIRED)
FIND_PACKAGE(DLib REQUIRED)
FIND_PACKAGE(DLoopDetector REQUIRED)
FIND_PACKAGE(G2O REQUIRED)
FIND_PACKAGE(Eigen3 REQUIRED)
FIND_PACKAGE(Cholmod REQUIRED)
INCLUDE_DIRECTORIES(include ${PCL_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${DBoW2_INCLUDE_DIRS} ${DLib_INCLUDE_DIRS} ${DLoopDetector_INCLUDE_DIRS} ${G2O_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} ${CHOLMOD_INCLUDE_DIRS})
LINK_DIRECTORIES(${PCL_LIBRARY_DIRS})
ADD_DEFINITIONS(${PCL_DEFINITIONS})
SET(HEADER_FILES include/config.h include/Difodo.h include/GraphOptimizer.h include/Input.h include/RANSAC_3D.h include/Shared.h include/TemplatedKeyframeSelection.h include/TemplatedLoopDetector3D.h include/util.h)
SET(SRC_FILES src/Difodo.cpp src/GraphOptimizer.cpp src/Input.cpp)
SET(G2O_LIBRARIES ${G2O_CLI_LIBRARY} ${G2O_CORE_LIBRARY} ${G2O_SOLVER_CHOLMOD} ${G2O_SOLVER_CSPARSE} ${G2O_SOLVER_CSPARSE_EXTENSION} ${G2O_SOLVER_DENSE} ${G2O_SOLVER_EIGEN} ${G2O_SOLVER_PCG} ${G2O_SOLVER_SLAM2D_LINEAR} ${G2O_SOLVER_STRUCTURE_ONLY} ${G2O_STUFF_LIBRARY} ${G2O_TYPES_DATA} ${G2O_TYPES_ICP} ${G2O_TYPES_SBA} ${G2O_TYPES_SCLAM2D} ${G2O_TYPES_SIM3} ${G2O_TYPES_SLAM2D} ${G2O_TYPES_SLAM3D})
ADD_EXECUTABLE(${PROJECT_NAME} src/main.cpp ${HEADER_FILES} ${SRC_FILES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${MRPT_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${DBoW2_LIBRARIES} ${DLib_LIBRARIES} ${G2O_LIBRARIES} ${CHOLMOD_LIBRARY})
MESSAGE(STATUS "MRPT Dir: " ${MRPT_DIR})
MESSAGE(STATUS "PCL Dir: " ${PCL_DIR})
MESSAGE(STATUS "OpenCV Dir: " ${OpenCV_DIR})
MESSAGE(STATUS "DBoW2 Lib: " ${DBoW2_LIBRARIES})
MESSAGE(STATUS "DBoW2 Inc: " ${DBoW2_INCLUDE_DIRS})
MESSAGE(STATUS "DLib Lib: " ${DLib_LIBRARIES})
MESSAGE(STATUS "DLib Inc: " ${DLib_INCLUDE_DIRS})
MESSAGE(STATUS "DLoopDetector Inc: " ${DLoopDetector_INCLUDE_DIRS})