Skip to content

Commit 876118b

Browse files
authored
clean up test dependencies for rosbag2_test_common (ros2#118)
* clean up test dependencies for rosbag2_test_common Signed-off-by: Karsten Knese <[email protected]> * use build and exec depend Signed-off-by: Karsten Knese <[email protected]>
1 parent ce40262 commit 876118b

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

rosbag2_test_common/CMakeLists.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,25 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1616
endif()
1717

1818
find_package(ament_cmake REQUIRED)
19-
20-
find_package(ament_cmake_gmock REQUIRED)
21-
find_package(ament_lint_auto REQUIRED)
2219
find_package(rclcpp REQUIRED)
23-
24-
ament_lint_auto_find_test_dependencies()
20+
find_package(rcutils REQUIRED)
2521

2622
add_library(${PROJECT_NAME} INTERFACE)
27-
2823
target_include_directories(${PROJECT_NAME} INTERFACE
2924
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
3025
$<INSTALL_INTERFACE:include>)
31-
3226
target_link_libraries(${PROJECT_NAME} INTERFACE rclcpp rcutils)
3327

34-
ament_export_dependencies(rclcpp)
35-
3628
install(
3729
DIRECTORY include/
3830
DESTINATION include)
3931

32+
if(BUILD_TESTING)
33+
find_package(ament_lint_auto REQUIRED)
34+
ament_lint_auto_find_test_dependencies()
35+
endif()
36+
37+
ament_export_dependencies(rclcpp rcutils)
38+
4039
ament_export_include_directories(include)
4140
ament_package()

rosbag2_test_common/package.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99

1010
<buildtool_depend>ament_cmake</buildtool_depend>
1111

12-
<test_depend>ament_cmake_gmock</test_depend>
12+
<build_depend>rclcpp</build_depend>
13+
<build_depend>rcutils</build_depend>
14+
15+
<exec_depend>rclcpp</exec_depend>
16+
<exec_depend>rcutils</exec_depend>
17+
1318
<test_depend>ament_lint_auto</test_depend>
1419
<test_depend>ament_lint_common</test_depend>
15-
<test_depend>rclcpp</test_depend>
16-
<test_depend>rcutils</test_depend>
17-
<build_export_depend>rclcpp</build_export_depend>
1820

1921
<export>
2022
<build_type>ament_cmake</build_type>

0 commit comments

Comments
 (0)