forked from APRIL-ZJU/OA-LICalib
-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
executable file
·139 lines (115 loc) · 3.86 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
cmake_minimum_required(VERSION 2.8.3)
project(oa_licalib)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
#SET(CXX_MARCH native)
#set(CMAKE_CXX_FLAGS "-ftemplate-backtrace-limit=0 -march=${CXX_MARCH} -O3 -DBASALT_USE_CHOLMOD -DBASALT_DISABLE_ASSERTS -DNDEBUG")
#set(CMAKE_CXX_FLAGS " -march=${CXX_MARCH} -O3")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE "RELEASE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -msse4.2")
#add_definitions(-O3 -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
# set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/" ${CMAKE_MODULE_PATH})
#set(EIGEN_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/eigen")
set(CERES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/build-ceres-slover")
#find_package(Ceres REQUIRED)
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
set(STD_CXX_FS stdc++fs)
find_package(Ceres REQUIRED)
include_directories(${CERES_INCLUDE_DIRS})
message(STATUS "Found Eigen headers in: ${EIGEN3_INCLUDE_DIR}")
message(STATUS "Found ceres headers in: ${CERES_INCLUDE_DIRS}")
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
geometry_msgs
nav_msgs
message_generation
pcl_conversions
pcl_ros
sensor_msgs
std_msgs
tf
eigen_conversions
tf_conversions
ndt_omp
roslib
)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
#find_package(PkgConfig REQUIRED)
#pkg_check_modules(YAML_CPP REQUIRED yaml-cpp)
#include_directories(${YAML_CPP_INCLUDEDIR})
find_package(yaml-cpp REQUIRED)
include_directories(${YAML_INCLUDE_DIRS})
set(PANGOLIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/build-pangolin")
find_package(Pangolin REQUIRED)
## Generate messages in the 'msg' folder
add_message_files(
FILES
feature_cloud.msg
imu_array.msg
pose_array.msg
)
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs # Or other packages containing msgs
sensor_msgs
)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS std_msgs sensor_msgs
# LIBRARIES spline_test
# CATKIN_DEPENDS other_catkin_pkg
# DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
${catkin_INCLUDE_DIRS}
${Pangolin_INCLUDE_DIRS}
)
include_directories(thirdparty/Sophus)
# Set link libraries used by all binaries
list(APPEND thirdparty_libraries
${Boost_LIBRARIES}
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${OpenCV_LIBS}
${YAML_CPP_LIBRARIES}
${Pangolin_LIBRARIES}
ceres
)
################ Library #######################
add_library(lib_calib
src/trajectory/se3_trajectory.cpp
src/trajectory/trajectory_estimator.cpp
src/trajectory/trajectory_viewer.cpp
src/calib/lidar_localization.cpp
src/calib/lidar_ndt_odometry.cpp
src/calib/surfel_association.cpp
src/calib/inertial_initializer.cpp
src/calib/scan_undistortion.cpp
)
target_link_libraries(lib_calib ${thirdparty_libraries})
add_dependencies(lib_calib ${PROJECT_NAME}_generate_messages_cpp)
################# Node ###################
add_executable(li_calib_node src/app/li_calib_node.cpp src/calib/calib_helper.cpp)
target_link_libraries(li_calib_node lib_calib ${thirdparty_libraries})
add_dependencies(li_calib_node ${PROJECT_NAME}_generate_messages_cpp)
add_executable(map_evaluation_tools src/app/map_evaluation_tools.cpp)
target_link_libraries(map_evaluation_tools ${thirdparty_libraries})