Skip to content

Commit 2f7470a

Browse files
Only install it in case of BUILD_TESTING
1 parent aa8f635 commit 2f7470a

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

kinematics_interface/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ install(
4141
RUNTIME DESTINATION bin
4242
)
4343

44+
if(BUILD_TESTING)
45+
find_package(ament_cmake_gmock REQUIRED)
46+
find_package(ros2_control_test_assets REQUIRED)
47+
48+
install(
49+
DIRECTORY test/
50+
DESTINATION include/kinematics_interface/kinematics_interface
51+
)
52+
ament_export_dependencies(ament_cmake_gmock ros2_control_test_assets)
53+
endif()
54+
4455
ament_export_targets(export_kinematics_interface HAS_LIBRARY_TARGET)
4556
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS} Eigen3)
4657
ament_package()

kinematics_interface/package.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
<depend>eigen</depend>
2727
<depend>rclcpp_lifecycle</depend>
2828

29+
<test_depend>ament_cmake_gmock</test_depend>
30+
<test_depend>ros2_control_test_assets</test_depend>
31+
2932
<export>
3033
<build_type>ament_cmake</build_type>
3134
</export>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
//
1515
/// \author: Paul Gesel, Christoph Froehlich
1616

17-
#ifndef KINEMATICS_INTERFACE__KINEMATICS_INTERFACE_COMMON_TESTS_HPP_
18-
#define KINEMATICS_INTERFACE__KINEMATICS_INTERFACE_COMMON_TESTS_HPP_
17+
#ifndef KINEMATICS_INTERFACE_COMMON_TESTS_HPP_
18+
#define KINEMATICS_INTERFACE_COMMON_TESTS_HPP_
1919

2020
#include <gmock/gmock.h>
2121
#include <memory>
@@ -393,4 +393,4 @@ REGISTER_TYPED_TEST_SUITE_P(
393393
plugin_calculate_frame_difference_std_vector, incorrect_input_sizes, plugin_no_robot_description,
394394
plugin_no_parameter_tip);
395395

396-
#endif // KINEMATICS_INTERFACE__KINEMATICS_INTERFACE_COMMON_TESTS_HPP_
396+
#endif // KINEMATICS_INTERFACE_COMMON_TESTS_HPP_

kinematics_interface_kdl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ pluginlib_export_plugin_description_file(kinematics_interface kinematics_interfa
3838

3939
if(BUILD_TESTING)
4040
find_package(ament_cmake_gmock REQUIRED)
41-
find_package(ros2_control_test_assets REQUIRED)
4241

4342
ament_add_gmock(
4443
test_kinematics_interface_kdl
4544
test/test_kinematics_interface_kdl.cpp
4645
)
46+
# TODO(christophfroehlich): Remove dependency on ros2_control_test_assets
4747
target_link_libraries(test_kinematics_interface_kdl kinematics_interface_kdl ros2_control_test_assets::ros2_control_test_assets)
4848
endif()
4949

kinematics_interface_kdl/package.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
<depend>tf2_eigen_kdl</depend>
3232

3333
<test_depend>ament_cmake_gmock</test_depend>
34-
<test_depend>ros2_control_test_assets</test_depend>
35-
3634
<export>
3735
<build_type>ament_cmake</build_type>
3836
</export>

0 commit comments

Comments
 (0)