diff --git a/CMakeLists.txt b/CMakeLists.txt index 931ba14..538b8ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,7 +173,12 @@ endif() # ======================================================== # Test executables # ======================================================== -if(BUILD_TESTING) +# Tests are OFF by default in both build modes; enable with -DBUILD_ROBOT_LASER_GEOMETRY_TESTS=ON. +# Own flag instead of the shared BUILD_TESTING: any package calling include(CTest) sets +# BUILD_TESTING=ON for the whole CMake tree and would switch these tests back on. +option(BUILD_ROBOT_LASER_GEOMETRY_TESTS "Build the robot_laser_geometry unit tests" OFF) + +if(BUILD_ROBOT_LASER_GEOMETRY_TESTS) enable_testing() if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test/projection_test.cpp)