forked from rai-opensource/spot_ros2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
73 lines (60 loc) · 1.93 KB
/
Copy pathCMakeLists.txt
File metadata and controls
73 lines (60 loc) · 1.93 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
# Copyright (c) 2024 Robotics and AI Institute LLC dba RAI Institute. All rights reserved.
cmake_minimum_required(VERSION 3.22)
# This is here so we can use jthread from C++ 20
set(CMAKE_CXX_STANDARD 20)
project(spot_hardware_interface)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# Dependencies
find_package(ament_cmake REQUIRED)
set(THIS_PACKAGE_INCLUDE_DEPENDS
bondcpp
hardware_interface
bosdyn_api_msgs
bosdyn_cmake_module
pluginlib
rclcpp
rclcpp_lifecycle
spot_msgs
tl_expected
)
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
endforeach()
find_package(bosdyn REQUIRED)
# Add the hardware interface
add_library(
spot_hardware_interface
SHARED
src/spot_hardware_interface.cpp
src/spot_leasing_interface.cpp
)
target_compile_features(spot_hardware_interface PUBLIC cxx_std_20)
target_include_directories(spot_hardware_interface PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(spot_hardware_interface PUBLIC bosdyn::bosdyn_client)
ament_target_dependencies(
spot_hardware_interface PUBLIC
${THIS_PACKAGE_INCLUDE_DEPENDS}
)
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(${PROJECT_NAME} PRIVATE "SPOT_HARDWARE_INTERFACE_BUILDING_DLL")
# Export hardware plugin
pluginlib_export_plugin_description_file(hardware_interface spot_hardware_interface.xml)
install(
DIRECTORY include/
DESTINATION include
)
install(TARGETS spot_hardware_interface
EXPORT export_spot_hardware_interface
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
ament_export_targets(export_spot_hardware_interface HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS} bosdyn)
ament_package()