-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
86 lines (70 loc) · 2.93 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
# Minimum CMake vesion: limited by CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
cmake_minimum_required(VERSION 3.4)
if("$ENV{ROS_VERSION}" STREQUAL "2")
set(DETECTED_ROS2 TRUE)
endif()
# Tell CMake we'll use C++ for use in its tests/flags
project(mola_kiss_icp_wrapper LANGUAGES CXX)
# MOLA CMake scripts: "mola_xxx()"
find_package(mola_common REQUIRED)
# find dependencies:
find_package(mrpt-maps REQUIRED)
find_package(mrpt-tclap REQUIRED)
find_package(mp2p_icp_filters REQUIRED)
find_mola_package(mola_kernel)
# CLI apps
# ---------------------------------
find_package(mola_input_kitti_dataset) # optional
find_package(mola_input_kitti360_dataset) # optional
find_package(mola_input_rawlog) # optional
find_package(mola_input_mulran_dataset) # optional
find_package(mola_input_rosbag2) # optional
find_package(mola_input_paris_luco_dataset) # optional
# kiss_icp interface:
mola_add_executable(
TARGET mola-lidar-odometry-cli-kiss
SOURCES apps/mola-lidar-odometry-cli-kiss.cpp
LINK_LIBRARIES
mrpt::maps
mrpt::tclap
mola::mola_kernel
mola::mp2p_icp_filters
)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/submodules/kiss-icp/cpp/kiss_icp ${CMAKE_CURRENT_BINARY_DIR}/kiss_icp)
target_include_directories(mola-lidar-odometry-cli-kiss PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/submodules/kiss-icp/include)
target_link_libraries(mola-lidar-odometry-cli-kiss kiss_icp::pipeline)
if (mola_input_kitti_dataset_FOUND)
target_link_libraries(mola-lidar-odometry-cli-kiss mola::mola_input_kitti_dataset)
target_compile_definitions(mola-lidar-odometry-cli-kiss PRIVATE HAVE_MOLA_INPUT_KITTI)
endif()
if (mola_input_kitti360_dataset_FOUND)
target_link_libraries(mola-lidar-odometry-cli-kiss mola::mola_input_kitti360_dataset)
target_compile_definitions(mola-lidar-odometry-cli-kiss PRIVATE HAVE_MOLA_INPUT_KITTI360)
endif()
if (mola_input_mulran_dataset_FOUND)
target_link_libraries(mola-lidar-odometry-cli-kiss mola::mola_input_mulran_dataset)
target_compile_definitions(mola-lidar-odometry-cli-kiss PRIVATE HAVE_MOLA_INPUT_MULRAN)
endif()
if (mola_input_rawlog_FOUND)
target_link_libraries(mola-lidar-odometry-cli-kiss mola::mola_input_rawlog)
target_compile_definitions(mola-lidar-odometry-cli-kiss PRIVATE HAVE_MOLA_INPUT_RAWLOG)
endif()
if (mola_input_rosbag2_FOUND)
target_link_libraries(mola-lidar-odometry-cli-kiss mola::mola_input_rosbag2)
target_compile_definitions(mola-lidar-odometry-cli-kiss PRIVATE HAVE_MOLA_INPUT_ROSBAG2)
endif()
if (mola_input_paris_luco_dataset_FOUND)
target_link_libraries(mola-lidar-odometry-cli-kiss mola::mola_input_paris_luco_dataset)
target_compile_definitions(mola-lidar-odometry-cli-kiss PRIVATE HAVE_MOLA_INPUT_PARIS_LUCO)
endif()
# -----------------------------------------------------------------------------
# ROS2
# -----------------------------------------------------------------------------
if (DETECTED_ROS2)
# find dependencies
find_package(ament_cmake REQUIRED)
#ament_target_dependencies(MY_TARGET
# rclcpp...
#)
ament_package()
endif()