-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathCMakeLists.txt
112 lines (95 loc) · 2.65 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
# Catkin User Guide: http://www.ros.org/doc/groovy/api/catkin/html/user_guide/user_guide.html
# Catkin CMake Standard: http://www.ros.org/doc/groovy/api/catkin/html/user_guide/standards.html
cmake_minimum_required(VERSION 3.1)
project(mrpt_ekf_slam_3d)
#find catkin packages
find_package(catkin REQUIRED COMPONENTS
cmake_modules
roslib
roscpp
tf2
tf2_ros
tf2_geometry_msgs
std_msgs
nav_msgs
sensor_msgs
visualization_msgs
dynamic_reconfigure
roslaunch
mrpt_msgs_bridge
)
#find mrpt packages
find_package(mrpt-gui REQUIRED)
find_package(mrpt-slam REQUIRED)
find_package(mrpt-ros1bridge REQUIRED)
message(STATUS "MRPT_VERSION: ${mrpt-slam_VERSION}")
# fix for Noetic:
if(NOT EXISTS TBB::tbb AND TBB_LIBRARY AND TBB_INCLUDE_DIRS)
add_library(MY_TBB INTERFACE)
target_include_directories(MY_TBB INTERFACE ${TBB_INCLUDE_DIRS})
target_link_libraries(MY_TBB INTERFACE ${TBB_LIBRARY})
add_library(TBB::tbb ALIAS MY_TBB)
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
# High level of warnings.
# The -Wno-long-long is required in 64bit systems when including sytem headers.
# The -Wno-variadic-macros was needed for Eigen3, StdVector.h
add_compile_options(-Wall -Wno-long-long -Wno-variadic-macros)
# Workaround: Eigen <3.4 produces *tons* of warnings in GCC >=6. See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
if(NOT ${CMAKE_CXX_COMPILER_VERSION} LESS "6.0")
add_compile_options(-Wno-ignored-attributes -Wno-int-in-bool-context)
endif()
endif()
if(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")
add_compile_options(-O3)
endif()
catkin_package(
CATKIN_DEPENDS
nav_msgs
sensor_msgs
std_msgs
visualization_msgs
tf2
tf2_ros
tf2_geometry_msgs
mrpt_msgs_bridge
)
###########
## Build ##
###########
include_directories(
${catkin_INCLUDE_DIRS}
# ${Eigen_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS}
include
)
add_executable(mrpt_ekf_slam_3d
src/mrpt_ekf_slam_3d.cpp
src/mrpt_ekf_slam_3d_wrapper.cpp
src/mrpt_ekf_slam_3d_app.cpp
)
TARGET_LINK_LIBRARIES(mrpt_ekf_slam_3d
mrpt::gui
mrpt::slam
mrpt::ros1bridge
${catkin_LIBRARIES}
)
#############
## Install ##
#############
# Mark executables and/or libraries for installation
install(TARGETS mrpt_ekf_slam_3d
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
# Mark other files for installation (e.g. launch and bag files, etc.)
install(DIRECTORY
launch
tutorial
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
#############
## Testing ##
#############
# Add testing for *.launch files
roslaunch_add_file_check(launch)