This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
85 lines (69 loc) · 1.63 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
cmake_minimum_required(VERSION 3.5)
set(PROJECT_NAME land_plugins)
project(${PROJECT_NAME} VERSION 0.2.0)
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
# set Release as default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
# find dependencies
set(PROJECT_DEPENDENCIES
ament_cmake
ament_cmake_ros
pluginlib
land_plugin_base
as2_behavior
rclcpp
rclcpp_action
nav_msgs
as2_core
as2_msgs
motion_reference_handlers
std_srvs
)
foreach(DEPENDENCY ${PROJECT_DEPENDENCIES})
find_package(${DEPENDENCY} REQUIRED)
endforeach()
set(HEADER_HPP_FILES
include/${PROJECT_NAME}/${PROJECT_NAME}.hpp
)
include_directories(
include
include/${PROJECT_NAME}
)
set(SOURCE_CPP_FILES
src/land_plugin_platform.cpp
src/land_plugin_speed.cpp
)
add_library(${PROJECT_NAME} ${SOURCE_CPP_FILES})
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
ament_target_dependencies(
${PROJECT_NAME}
${PROJECT_DEPENDENCIES}
)
pluginlib_export_plugin_description_file(land_plugin_base plugins.xml)
if(BUILD_TESTING)
find_package(ament_cmake_cppcheck REQUIRED)
find_package(ament_cmake_clang_format REQUIRED)
ament_cppcheck(src/ include/ tests/)
ament_clang_format(src/ include/ tests/ --config ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format)
endif()
install(
TARGETS ${PROJECT_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
ament_export_libraries(
${PROJECT_NAME}
)
ament_export_targets(
export_${PROJECT_NAME}
)
ament_package()