-
Notifications
You must be signed in to change notification settings - Fork 517
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
74 lines (63 loc) · 2.03 KB
/
Copy pathCMakeLists.txt
File metadata and controls
74 lines (63 loc) · 2.03 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
cmake_minimum_required(VERSION 3.16)
project(effort_controllers)
find_package(ros2_control_cmake REQUIRED)
set_compiler_options()
export_windows_symbols()
set(THIS_PACKAGE_INCLUDE_DEPENDS
forward_command_controller
pluginlib
rclcpp
)
find_package(ament_cmake REQUIRED)
find_package(backward_ros REQUIRED)
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
endforeach()
add_library(effort_controllers SHARED
src/joint_group_effort_controller.cpp
)
target_compile_features(effort_controllers PUBLIC cxx_std_17)
target_include_directories(effort_controllers PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/effort_controllers>
)
target_link_libraries(effort_controllers PUBLIC
forward_command_controller::forward_command_controller
pluginlib::pluginlib
rclcpp::rclcpp
)
pluginlib_export_plugin_description_file(controller_interface effort_controllers_plugins.xml)
if(BUILD_TESTING)
find_package(ament_cmake_gmock REQUIRED)
find_package(controller_manager REQUIRED)
find_package(ros2_control_test_assets REQUIRED)
add_definitions(-DTEST_FILES_DIRECTORY="${CMAKE_CURRENT_SOURCE_DIR}/test")
ament_add_gmock(test_load_joint_group_effort_controller
test/test_load_joint_group_effort_controller.cpp
)
target_link_libraries(test_load_joint_group_effort_controller
effort_controllers
controller_manager::controller_manager
ros2_control_test_assets::ros2_control_test_assets
)
ament_add_gmock(test_joint_group_effort_controller
test/test_joint_group_effort_controller.cpp
)
target_link_libraries(test_joint_group_effort_controller
effort_controllers
)
endif()
install(
DIRECTORY include/
DESTINATION include/effort_controllers
)
install(
TARGETS effort_controllers
EXPORT export_effort_controllers
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
ament_export_targets(export_effort_controllers HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()