build: add BUILD_ROBOT_SENSOR_PORTS_TESTS option, off by default

Tests used to build whenever CATKIN_ENABLE_TESTING was on. They now also
need -DBUILD_ROBOT_SENSOR_PORTS_TESTS=ON, in both build modes.
This commit is contained in:
2026-11-17 20:36:12 +07:00
parent d09b7f40bc
commit a487e9e8e8

View File

@@ -256,7 +256,10 @@ endif()
# ========================================================
# Tests
# ========================================================
if(CATKIN_ENABLE_TESTING AND BUILDING_WITH_CATKIN)
# Tests are OFF by default in both build modes; enable with -DBUILD_ROBOT_SENSOR_PORTS_TESTS=ON.
option(BUILD_ROBOT_SENSOR_PORTS_TESTS "Build the robot_sensor_ports unit tests" OFF)
if(BUILD_ROBOT_SENSOR_PORTS_TESTS AND CATKIN_ENABLE_TESTING AND BUILDING_WITH_CATKIN)
if(NOT COMMAND catkin_add_gtest)
message(FATAL_ERROR "catkin_add_gtest NOT FOUND")