@@ -12,6 +12,7 @@ endif()
1212
1313find_package (ament_cmake REQUIRED)
1414find_package (control_msgs REQUIRED)
15+ find_package (pluginlib REQUIRED)
1516find_package (rcpputils REQUIRED)
1617find_package (rcutils REQUIRED)
1718find_package (tinyxml2_vendor REQUIRED)
@@ -23,7 +24,9 @@ add_library(
2324 src/components/actuator.cpp
2425 src/components/sensor.cpp
2526 src/components/system .cpp
27+ src/component_parser.cpp
2628 src/operation_mode_handle.cpp
29+ src/resource_manager.cpp
2730 src/robot_hardware.cpp
2831)
2932target_include_directories (
@@ -34,27 +37,15 @@ target_include_directories(
3437ament_target_dependencies(
3538 hardware_interface
3639 control_msgs
40+ pluginlib
3741 rcutils
3842 rcpputils
3943)
4044# Causes the visibility macros to use dllexport rather than dllimport,
4145# which is appropriate when building the dll but not consuming it.
4246target_compile_definitions (hardware_interface PRIVATE "HARDWARE_INTERFACE_BUILDING_DLL" )
43-
44- add_library (
45- component_parser SHARED
46- src/component_parser.cpp
47- )
48- target_include_directories (
49- component_parser
50- PUBLIC
51- include
52- )
53- ament_target_dependencies(
54- component_parser
55- TinyXML2
56- )
57- target_compile_definitions (component_parser PRIVATE "HARDWARE_INTERFACE_BUILDING_DLL" )
47+ # prevent pluginlib from using boost
48+ target_compile_definitions (hardware_interface PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS" )
5849
5950install (
6051 DIRECTORY include /
@@ -63,7 +54,6 @@ install(
6354
6455install (
6556 TARGETS
66- component_parser
6757 hardware_interface
6858 RUNTIME DESTINATION bin
6959 ARCHIVE DESTINATION lib
@@ -80,46 +70,59 @@ if(BUILD_TESTING)
8070 ament_target_dependencies(test_macros rcpputils)
8171
8272 ament_add_gmock(test_robot_hardware_interfaces test /test_robot_hardware_interface.cpp)
83- target_include_directories (test_robot_hardware_interfaces PRIVATE include )
8473 target_link_libraries (test_robot_hardware_interfaces hardware_interface)
8574
8675 ament_add_gmock(test_register_actuators test /test_register_actuators.cpp)
87- target_include_directories (test_register_actuators PRIVATE include )
8876 target_link_libraries (test_register_actuators hardware_interface)
8977 ament_target_dependencies(test_register_actuators rcpputils)
9078
9179 ament_add_gmock(test_register_joints test /test_register_joints.cpp)
92- target_include_directories (test_register_joints PRIVATE include )
9380 target_link_libraries (test_register_joints hardware_interface)
9481 ament_target_dependencies(test_register_joints rcpputils)
9582
9683 ament_add_gmock(test_actuator_handle test /test_actuator_handle.cpp)
97- target_include_directories (test_actuator_handle PRIVATE include )
9884 target_link_libraries (test_actuator_handle hardware_interface)
9985 ament_target_dependencies(test_actuator_handle rcpputils)
10086
10187 ament_add_gmock(test_joint_handle test /test_joint_handle.cpp)
102- target_include_directories (test_joint_handle PRIVATE include )
10388 target_link_libraries (test_joint_handle hardware_interface)
10489 ament_target_dependencies(test_joint_handle rcpputils)
10590
10691 ament_add_gmock(test_component_interfaces test /test_component_interfaces.cpp)
10792 target_link_libraries (test_component_interfaces hardware_interface)
10893
10994 ament_add_gmock(test_component_parser test /test_component_parser.cpp)
110- target_link_libraries (test_component_parser component_parser)
111- ament_target_dependencies(test_component_parser TinyXML2)
95+ target_link_libraries (test_component_parser hardware_interface)
96+
97+ add_library (test_components SHARED
98+ test /test_components/test_actuator.cpp
99+ test /test_components/test_sensor.cpp
100+ test /test_components/test_system.cpp)
101+ target_link_libraries (test_components hardware_interface)
102+ ament_target_dependencies(test_components
103+ pluginlib)
104+ install (TARGETS test_components
105+ DESTINATION lib
106+ )
107+ pluginlib_export_plugin_description_file(
108+ hardware_interface test /test_components/test_components.xml)
109+
110+ ament_add_gmock(
111+ test_resource_manager
112+ test /test_resource_manager.cpp
113+ )
114+ target_link_libraries (test_resource_manager hardware_interface)
112115endif ()
113116
114117ament_export_include_directories(
115118 include
116119)
117120ament_export_libraries(
118- component_parser
119121 hardware_interface
120122)
121123ament_export_dependencies(
122124 control_msgs
125+ pluginlib
123126 rcpputils
124127 tinyxml2_vendor
125128 TinyXML2
0 commit comments