-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
136 lines (119 loc) · 3.22 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
cmake_minimum_required(VERSION 2.8.3)
project(hdl_localization)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
add_definitions(-std=c++11)
set(CMAKE_CXX_FLAGS "-std=c++11")
else()
# -mavx causes a lot of errors!!
if("$ENV{ROS_DISTRO}" STRGREATER "melodic")
add_definitions(-std=c++17 -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2)
set(CMAKE_CXX_FLAGS "-std=c++17 -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2")
else()
add_definitions(-std=c++11 -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2)
set(CMAKE_CXX_FLAGS "-std=c++11 -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2")
endif()
endif()
# pcl 1.7 causes a segfault when it is built with debug mode
set(CMAKE_BUILD_TYPE "RELEASE")
find_package(catkin REQUIRED COMPONENTS
nodelet
tf2
tf2_ros
tf2_eigen
tf2_geometry_msgs
eigen_conversions
pcl_ros
roscpp
rospy
sensor_msgs
geometry_msgs
message_generation
ndt_omp
fast_gicp
hdl_global_localization
actionlib
actionlib_msgs
nav_msgs
)
find_package(PCL 1.7 REQUIRED)
find_package(Eigen3 REQUIRED)
set(GTSAM_DIR "/home/alwen/third_parties/gtsam/build")
find_package(GTSAM REQUIRED QUIET)
message(STATUS "GTSAM_INCLUDE_DIR:" ${GTSAM_INCLUDE_DIR})
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
message(STATUS "PCL_INCLUDE_DIRS:" ${PCL_INCLUDE_DIRS})
message(STATUS "PCL_LIBRARY_DIRS:" ${PCL_LIBRARY_DIRS})
message(STATUS "PCL_DEFINITIONS:" ${PCL_DEFINITIONS})
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()
########################
## message generation ##
########################
add_message_files(FILES
ScanMatchingStatus.msg
PointCloudContainer.msg
OdometryContainer.msg
)
add_action_files(
FILES
TMM.action
)
generate_messages(
DEPENDENCIES
actionlib_msgs
std_msgs
sensor_msgs
nav_msgs
geometry_msgs
)
###################################
## catkin specific configuration ##
###################################
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp actionlib actionlib_msgs message_runtime sensor_msgs nav_msgs geometry_msgs
DEPENDS Eigen3 GTSAM
# LIBRARIES hdl_scan_matching_odometry
# CATKIN_DEPENDS pcl_ros roscpp sensor_msgs
# DEPENDS system_lib
)
###########
## Build ##
###########
include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
${GTSAM_INCLUDE_DIR}
)
link_directories(include
${GTSAM_LIBRARY_DIRS}
${PCL_LIBRARY_DIRS}
)
# nodelets
add_library(hdl_localization_nodelet
src/hdl_localization/pose_estimator.cpp
apps/hdl_localization_nodelet.cpp
)
target_link_libraries(hdl_localization_nodelet
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${GTSAM_LIBRARY_DIRS}
gtsam
)
add_dependencies(hdl_localization_nodelet ${PROJECT_NAME}_gencpp hdl_localization_generate_messages_cpp)
add_library(globalmap_server_nodelet apps/globalmap_server_nodelet.cpp)
target_link_libraries(globalmap_server_nodelet
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${GTSAM_LIBRARY_DIRS}
gtsam
)
add_executable(merge_map apps/MergeMap.cpp)
target_link_libraries(merge_map ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${GTSAM_LIBRARY_DIRS}
gtsam)