forked from odriverobotics/ros_odrive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
61 lines (47 loc) · 1.36 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
cmake_minimum_required(VERSION 3.8)
project(odrive_can)
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(rosidl_default_generators REQUIRED)
rosidl_generate_interfaces(${PROJECT_NAME}
"msg/ControlMessage.msg"
"msg/ControllerStatus.msg"
"msg/ODriveStatus.msg"
"msg/ODriveStatusAdvanced.msg"
"msg/ControlVelocityGains.msg"
"msg/ControlPositionGain.msg"
"msg/ControlTrajVelLim.msg"
"msg/ControlTrajAccelLims.msg"
"msg/RebootMessage.msg"
"srv/AxisState.srv"
"srv/Estop.srv"
"srv/ClearErrors.srv"
"srv/ValueAccess.srv"
)
ament_export_dependencies(rosidl_default_runtime)
include_directories(include)
add_executable(odrive_can_node
src/epoll_event_loop.cpp
src/socket_can.cpp
src/odrive_can_node.cpp
src/main.cpp
include/odrive_can_node.hpp)
ament_target_dependencies(odrive_can_node
rclcpp
)
target_compile_features(odrive_can_node PRIVATE cxx_std_20)
install(
TARGETS odrive_can_node
DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY launch
DESTINATION share/${PROJECT_NAME}
)
rosidl_get_typesupport_target(cpp_typesupport_target
${PROJECT_NAME} rosidl_typesupport_cpp)
target_link_libraries(odrive_can_node "${cpp_typesupport_target}")
ament_package()