-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
90 lines (76 loc) · 1.69 KB
/
Copy pathCMakeLists.txt
File metadata and controls
90 lines (76 loc) · 1.69 KB
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
cmake_minimum_required(VERSION 3.8)
project(mock_serial_hardware)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(hardware_interface REQUIRED)
find_package(controller_manager REQUIRED)
find_package(pluginlib REQUIRED)
# =====================
# Include directories
# =====================
include_directories(
include
)
# =====================
# Hardware plugin library
# =====================
add_library(
mock_serial_hardware
SHARED
src/mock_serial_driver.cpp
src/mock_hardware_interface.cpp
)
ament_target_dependencies(
mock_serial_hardware
rclcpp
hardware_interface
pluginlib
)
# Required for pluginlib
target_compile_definitions(
mock_serial_hardware
PRIVATE "MOCK_SERIAL_HARDWARE_BUILDING_DLL"
)
# =====================
# Export plugin
# =====================
pluginlib_export_plugin_description_file(
hardware_interface
mock_serial_hardware.xml
)
# =====================
# Install
# =====================
install(
TARGETS mock_serial_hardware
EXPORT export_mock_serial_hardware
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
# install(
# DIRECTORY include/
# DESTINATION include
# )
install(
DIRECTORY launch config urdf rviz
DESTINATION share/${PROJECT_NAME}
)
install(
FILES mock_serial_hardware.xml
DESTINATION share/${PROJECT_NAME}
)
# =====================
# Export package
# =====================
ament_export_targets(export_mock_serial_hardware HAS_LIBRARY_TARGET)
ament_export_dependencies(
rclcpp
hardware_interface
pluginlib
)
ament_package()