-
Notifications
You must be signed in to change notification settings - Fork 91
/
CMakeLists.txt
64 lines (56 loc) · 2.05 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
cmake_minimum_required( VERSION 2.8 )
project ( myslam )
# compile settings
set( CMAKE_CXX_COMPILER "g++" )
set( CMAKE_BUILD_TYPE "Debug" )
# set( CMAKE_BUILD_TYPE "Release" ) # *** stack smashing detected ***: <unknown> terminated
set( CMAKE_CXX_FLAGS "-std=c++11 -O3" )
# list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules )
set( EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin )
set( LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib )
# set ccache (for speeding up)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif(CCACHE_FOUND)
set (CMAKE_CXX_FLAGS "-DPCL_ONLY_CORE_POINT_TYPES=ON -DNO_EXPLICIT_INSTANTIATIONS")
############### Dependencies ######################
# Eigen
include_directories( "/usr/include/eigen3" )
# OpenCV
find_package( OpenCV 3.4 REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
# Sophus
find_package( Sophus REQUIRED )
include_directories( ${Sophus_INCLUDE_DIRS} )
# G2O
list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules )
find_package( G2O REQUIRED )
find_package( CSparse REQUIRED ) ## note!! if the csparse is not found, please install: sudo apt-get install libsuitesparse-dev
include_directories( ${G2O_INCLUDE_DIRS} )
include_directories( ${CSPARSE_INCLUDE_DIR} )
# PCL
find_package( PCL REQUIRED )
include_directories( ${PCL_INCLUDE_DIRS} )
add_definitions( ${PCL_DEFINITIONS} )
# Combine the above libraries
set( THIRD_PARTY_LIBS
${OpenCV_LIBS}
${PCL_LIBRARIES}
${Sophus_LIBRARIES} # If "make install" is good, use this line
libSophus.so # If "make install" failed, copy files manully to usr/lib and usr/include, and use this line
g2o_core g2o_stuff g2o_types_sba g2o_csparse_extension
${CSPARSE_LIBRARY}
)
############### My Files ###############
include_directories( ${PROJECT_SOURCE_DIR}/include )
add_subdirectory( src )
add_subdirectory( test )
add_executable(run_vo run_vo.cpp)
target_link_libraries( run_vo
basics
geometry
display
vo
)