-
Notifications
You must be signed in to change notification settings - Fork 162
/
CMakeLists.txt
109 lines (88 loc) · 2.84 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
cmake_minimum_required(VERSION 2.8.3)
project(msckf_mono)
set( CMAKE_EXPORT_COMPILE_COMMANDS ON )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -msse4.2 -msse -msse2 -mavx -funroll-loops")
SET(CMAKE_BUILD_TYPE "RelWithDebInfo")
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++14 -DEIGEN_NO_DEBUG")
IF(DEFINED ENV{ARM_ARCHITECTURE})
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -mfpu=neon -march=armv7-a")
ELSE()
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -msse -msse4.2 -msse2")
ENDIF()
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -std=c++14 -g")
find_package(cmake_modules REQUIRED)
find_package(Eigen REQUIRED)
find_package(OpenCV REQUIRED)
# separate install -- https://github.com/uzh-rpg/fast
find_package(fast REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
image_transport
cv_bridge
sensor_msgs
pcl_conversions
pcl_ros
message_generation
)
## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED)
# Generate messages in the 'msg' folder
add_message_files(
FILES
CamState.msg
CamStates.msg
StageTiming.msg
)
# Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs # Or other packages containing msgs
geometry_msgs # Or other packages containing msgs
)
###################################
## catkin specific configuration ##
###################################
catkin_package(
DEPENDS Eigen
INCLUDE_DIRS include
LIBRARIES msckf_mono
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
include
${Eigen_INCLUDE_DIRS}
${OpenCV_DIR}
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${fast_INCLUDE_DIRS}
)
LIST(APPEND LINK_LIBS
${OpenCV_LIBS}
${catkin_LIBRARIES}
${fast_LIBRARIES}
)
LIST(APPEND MSCKF_SRCS
src/corner_detector.cpp
src/ros_interface.cpp
)
add_library(msckf_mono
${MSCKF_SRCS}
)
target_link_libraries(msckf_mono
${LINK_LIBS})
add_executable(asl_msckf datasets/asl_msckf.cpp datasets/asl_readers.cpp)
target_link_libraries(asl_msckf msckf_mono ${LINK_LIBS})
add_executable(asl_msckf_no_ground_truth datasets/asl_msckf_no_ground_truth.cpp datasets/asl_readers.cpp)
target_link_libraries(asl_msckf_no_ground_truth msckf_mono ${LINK_LIBS})
add_executable(msckf_mono_node nodes/msckf_mono_node.cpp)
target_link_libraries(msckf_mono_node msckf_mono ${LINK_LIBS})
# add_executable(pcv_msckf datasets/penncosy_msckf.cpp datasets/penncosy_readers.cpp)
# target_link_libraries(pcv_msckf ${LINK_LIBS} msckf_mono)