ros-tooling / system_metrics_collector

[DEPRECATED] Lightweight, real-time system metrics collector for ROS2 systems
Apache License 2.0
18 stars 8 forks source link

Fix 'test_subscriber_topic_statistics' must be a valid target name build failure #175

Closed jaisontj closed 4 years ago

jaisontj commented 4 years ago

As seen here, building this package with

colcon build --build-base build_isolated --install-base install_isolated --test-result-base test_results --event-handlers console_cohesion+ --cmake-args -DBUILD_TESTING=0

throws the following error:

06:44:21 --- stderr: system_metrics_collector
06:44:21 CMake Error at /opt/ros/foxy/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:37 (message):
06:44:21   rosidl_target_interfaces() the first argument
06:44:21   'test_subscriber_topic_statistics' must be a valid target name
06:44:21 Call Stack (most recent call first):
06:44:21   CMakeLists.txt:153 (rosidl_target_interfaces)
06:44:21 
06:44:21 
06:44:21 ---

This is because test_subscriber_topic_statistics is non existent when BUILD_TESTING is false.

Fix includes moving the following inside the BUILD_TESTING block.

rosidl_target_interfaces(test_subscriber_topic_statistics system_metrics_collector_test_msgs "rosidl_typesupport_cpp")