build: add BUILD_DEPTH_IMAGE_PROC_TESTS option, off by default

Tests used to build whenever CATKIN_ENABLE_TESTING was on. They now also
need -DBUILD_DEPTH_IMAGE_PROC_TESTS=ON, in both build modes.

Only the test_point_cloud_xyz gtest is gated. depth_image_proc_test_node still
builds, because launch/depth_image_proc_test.launch runs it.
This commit is contained in:
2026-11-17 20:36:12 +07:00
parent 5871e0c738
commit 89f3b9c8a3

View File

@@ -232,7 +232,12 @@ if(BUILDING_WITH_CATKIN)
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
) )
if(CATKIN_ENABLE_TESTING) # Unit tests are OFF by default in both build modes; enable with
# -DBUILD_DEPTH_IMAGE_PROC_TESTS=ON. depth_image_proc_test_node above is not a
# unit test: launch/depth_image_proc_test.launch runs it, so it always builds.
option(BUILD_DEPTH_IMAGE_PROC_TESTS "Build the depth_image_proc unit tests" OFF)
if(BUILD_DEPTH_IMAGE_PROC_TESTS AND CATKIN_ENABLE_TESTING)
find_package(GTest REQUIRED) find_package(GTest REQUIRED)
catkin_add_gtest(test_point_cloud_xyz catkin_add_gtest(test_point_cloud_xyz