-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (47 loc) · 1.58 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
cmake_minimum_required(VERSION 3.8)
if("$ENV{ROS_VERSION}" STREQUAL "2")
set(DETECTED_ROS2 TRUE)
endif()
project(mola_benchmark_metric_maps_kitti LANGUAGES CXX)
# ---------------------------------------------------------------------------
# Set the output directory of each example to its corresponding subdirectory
# in the binary tree:
# ---------------------------------------------------------------------------
set(EXECUTABLE_OUTPUT_PATH ".")
# The list of "libs" which can be included can be found in:
# https://www.mrpt.org/Libraries
# Add the top-level dependencies only.
# --------------------------------------------------------------------------
find_package(mrpt-maps 2.11 REQUIRED)
find_package(mrpt-gui REQUIRED)
find_package(mola_input_kitti_dataset REQUIRED)
find_package(mola_yaml REQUIRED)
find_package(mola_metric_maps REQUIRED)
# Define the executable target:
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME}
mrpt::maps
mrpt::gui
mola::mola_input_kitti_dataset
mola::mola_yaml
mola::mola_metric_maps
)
install(TARGETS ${PROJECT_NAME})
# Set optimized building:
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
target_compile_options(${PROJECT_NAME} PRIVATE
-Wall -pedantic
-O3
)
endif()
# -----------------------------------------------------------------------------
# ROS2
# -----------------------------------------------------------------------------
if (DETECTED_ROS2)
# find dependencies
find_package(ament_cmake REQUIRED)
#ament_target_dependencies(MY_TARGET
# rclcpp...
#)
ament_package()
endif()