forked from TUMFTM/3DVehicleDynamicsStateEstimation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
64 lines (55 loc) · 1.76 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
cmake_minimum_required(VERSION 3.12)
# CONFIGURE PKG HERE
# ==========================================
set(PROJECT_NAME ssa_estimation_node_cpp)
set(NODE_EXECUTABLE_NAME ssa_estimation_node)
set(NODE_EXECUTABLE_PATH src/ssa_estimation_node_main.cpp)
set(NODE_DEPENDENCIES
rclcpp
param_manager_cpp
ros_param_helpers_cpp
ros_debug_helpers_cpp
tum_types_cpp
tum_helpers_cpp
msgs
nav_msgs
sensor_msgs
ssa_estimation_constants
ssa_estimation_cpp
diagnostic_msgs
tum_type_conversions_ros_cpp
ros2_watchdog_cpp
)
# ============================================
# END OF CONFIGURATION
project(${PROJECT_NAME})
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
find_package(ament_cmake REQUIRED)
foreach(pkg_name ${NODE_DEPENDENCIES})
find_package(${pkg_name} REQUIRED)
endforeach()
# section: BUILD LIBRARY TARGET TO IMPORT NODE CLASS WITHIN OTHER PKGS
# ====================================================================
add_executable(${NODE_EXECUTABLE_NAME} ${NODE_EXECUTABLE_PATH})
target_include_directories(${NODE_EXECUTABLE_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_compile_options(${NODE_EXECUTABLE_NAME} PUBLIC -Ofast)
ament_target_dependencies(${NODE_EXECUTABLE_NAME} ${NODE_DEPENDENCIES})
ament_export_dependencies(${NODE_DEPENDENCIES}) # other dependencies so client does not need to call find_package on them
install(
TARGETS ${NODE_EXECUTABLE_NAME}
DESTINATION lib/${PROJECT_NAME}
)
install(
DIRECTORY include/
DESTINATION include
)
# section: GENERAL
# ====================================================================
ament_package()