build: add BUILD_MISSION_ADAPTERS_TESTS option, off by default

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

View File

@@ -360,7 +360,10 @@ endif()
# EXCLUDE_FROM_ALL để binary có mặt sau `catkin_make` thường — chạy thẳng # EXCLUDE_FROM_ALL để binary có mặt sau `catkin_make` thường — chạy thẳng
# ./devel/lib/mission_adapters/<test> theo đúng quy trình verify của repo. # ./devel/lib/mission_adapters/<test> theo đúng quy trình verify của repo.
# ======================================================== # ========================================================
if(CATKIN_ENABLE_TESTING AND BUILDING_WITH_CATKIN) # Test mặc định OFF trong cả hai chế độ build; bật bằng -DBUILD_MISSION_ADAPTERS_TESTS=ON.
option(BUILD_MISSION_ADAPTERS_TESTS "Build the mission_adapters unit tests" OFF)
if(BUILD_MISSION_ADAPTERS_TESTS AND CATKIN_ENABLE_TESTING AND BUILDING_WITH_CATKIN)
if(NOT COMMAND catkin_add_gtest) if(NOT COMMAND catkin_add_gtest)
message(FATAL_ERROR "catkin_add_gtest NOT FOUND") message(FATAL_ERROR "catkin_add_gtest NOT FOUND")