This repository was archived by the owner on Feb 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-14
lines changed Expand file tree Collapse file tree 2 files changed +28
-14
lines changed Original file line number Diff line number Diff line change @@ -62,18 +62,29 @@ install(TARGETS health_metric_collector
62
62
63
63
if (CATKIN_ENABLE_TESTING)
64
64
find_package (rostest REQUIRED)
65
- include_directories (/usr/include /gmock /usr/src/gmock)
66
- add_library (libgmock /usr/src/gmock/src/gmock-all .cc)
67
-
68
- add_rostest_gtest(test_health_metric_collector
69
- test /test_health_metric_collector.test
70
- test /health_metric_collector_test.cpp
71
- )
72
-
73
- target_include_directories (test_health_metric_collector
74
- PRIVATE include
75
- ${catkin_INCLUDE_DIRS}
76
- )
77
-
78
- target_link_libraries (test_health_metric_collector ${catkin_LIBRARIES} libgmock collector_lib)
65
+ find_package (GMock QUIET )
66
+ if (GMOCK_FOUND)
67
+ add_rostest_gmock(test_health_metric_collector
68
+ test /test_health_metric_collector.test
69
+ test /health_metric_collector_test.cpp
70
+ )
71
+ target_include_directories (test_health_metric_collector
72
+ PRIVATE include
73
+ ${catkin_INCLUDE_DIRS}
74
+ ${GMOCK_INCLUDE_DIRS}
75
+ )
76
+ target_link_libraries (test_health_metric_collector ${catkin_LIBRARIES} collector_lib ${GMOCK_BOTH_LIBRARIES} )
77
+ else ()
78
+ include_directories (/usr/include /gmock /usr/src/gmock)
79
+ add_library (${PROJECT_NAME} _libgmock /usr/src/gmock/src/gmock-all .cc)
80
+ add_rostest_gtest(test_health_metric_collector
81
+ test /test_health_metric_collector.test
82
+ test /health_metric_collector_test.cpp
83
+ )
84
+ target_include_directories (test_health_metric_collector
85
+ PRIVATE include
86
+ ${catkin_INCLUDE_DIRS}
87
+ )
88
+ target_link_libraries (test_health_metric_collector ${catkin_LIBRARIES} collector_lib ${PROJECT_NAME} _libgmock)
89
+ endif ()
79
90
endif ()
Original file line number Diff line number Diff line change 21
21
22
22
<exec_depend >message_runtime</exec_depend >
23
23
<exec_depend >cloudwatch_metrics_collector</exec_depend >
24
+
25
+ <test_depend >rostest</test_depend >
26
+ <test_depend >google-mock</test_depend >
24
27
</package >
You can’t perform that action at this time.
0 commit comments