diff --git a/CMakeLists.txt b/CMakeLists.txt index cab576d..d8cf8fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -278,7 +278,12 @@ endif() # ======================================================== # Test executables # ======================================================== -option(BUILD_COSTMAP_TESTS "Build robot_costmap_2d test executables" ON) +# Default follows the build mode, not a fixed value: a catkin workspace is a +# development machine and gets the tests, while the standalone CMake build is how +# the robot is deployed and must not need GTest installed at all. Force it on with +# -DBUILD_COSTMAP_TESTS=ON to run the tests from a standalone build. +option(BUILD_COSTMAP_TESTS "Build robot_costmap_2d test executables" + ${BUILDING_WITH_CATKIN}) if(BUILD_COSTMAP_TESTS) find_package(GTest REQUIRED)