forked from rsasaki0109/littleslam_ros2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
95 lines (79 loc) · 2.02 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
cmake_minimum_required(VERSION 3.5)
project(littleslam_ros2)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
find_package(ament_cmake REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(Eigen3)
find_package (PCL 1.8 REQUIRED)
add_subdirectory(./src/LittleSLAM/framework)
add_subdirectory(./src/LittleSLAM/hook)
add_subdirectory(./src/LittleSLAM/cui)
include_directories(
include
${EIGEN3_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
src/LittleSLAM/framework
src/LittleSLAM/hook
src/LittleSLAM/cui
)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_library(littleslam_ros2_component SHARED src/littleslam_ros2_component.cpp)
target_compile_definitions(littleslam_ros2_component PRIVATE "LITTLESLAM_BUILDING_DLL")
ament_target_dependencies(littleslam_ros2_component
rclcpp
rclcpp_components
sensor_msgs
nav_msgs
tf2
tf2_ros
tf2_geometry_msgs
pcl_conversions
class_loader
)
rclcpp_components_register_nodes(
littleslam_ros2_component "littleslam_ros2::Littleslam"
)
add_executable(${PROJECT_NAME}
src/littleslam_ros2.cpp
src/littleslam_ros2_component.cpp
src/LittleSLAM/framework/SlamFrontEnd.cpp
src/LittleSLAM/cui/FrameworkCustomizer.cpp
)
target_link_libraries(${PROJECT_NAME}
${PROJECT_NAME}_component
${PCL_LIBRARIES}
framework
hook
)
ament_target_dependencies(${PROJECT_NAME}
rclcpp
sensor_msgs
tf2
tf2_ros
tf2_geometry_msgs
)
install(TARGETS
littleslam_ros2_component
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(TARGETS
littleslam_ros2
DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}
)
ament_package()