TetraIF migration and Unittest Implementation for it

Entire-Checkpoint: 14d1fef0cf36
This commit is contained in:
berrux-dev committed 2026-09-12 13:54:34 +02:00
1 parent a86f9b5bac
commit ba212f9dce
78 files changed
+1611 -640

No files matched your search

+41 -1
View File
@@ -96,7 +96,12 @@ include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsCore)
include_directories(${CMAKE_SOURCE_DIR}/include/Viewer/SituationMap)
include_directories(${CMAKE_SOURCE_DIR}/include/OperatorManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/FileManagement)
SET(CMAKE_CXX_STANDARD 17)
# The project targets C++17. This was a plain SET() before, which silently
# shadowed any -DCMAKE_CXX_STANDARD= passed on the command line; the IF guard
# makes that override work again without changing the default.
IF(NOT CMAKE_CXX_STANDARD)
SET(CMAKE_CXX_STANDARD 17)
ENDIF()
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
SET(CMAKE_CXX_VISIBILITY_PRESET hidden)
@@ -180,6 +185,34 @@ ENDIF()
ENABLE_TESTING()
INCLUDE(CTest)
# GoogleTest is resolved once here so that every unittest/ subdirectory can just
# link GTest::gtest_main. Set LTS_FETCH_GOOGLETEST=OFF on an offline build machine
# that has no system-wide GTest; the unit tests are then skipped instead of
# failing the configure step.
OPTION(LTS_FETCH_GOOGLETEST "Download GoogleTest when no system-wide GTest is found" ON)
IF(BUILD_TESTING)
FIND_PACKAGE(GTest QUIET)
IF(NOT TARGET GTest::gtest_main AND LTS_FETCH_GOOGLETEST)
INCLUDE(FetchContent)
FETCHCONTENT_DECLARE(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0
)
SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
SET(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
FETCHCONTENT_MAKEAVAILABLE(googletest)
ENDIF()
IF(TARGET GTest::gtest_main)
SET(LTS_HAVE_GTEST TRUE)
ELSE()
SET(LTS_HAVE_GTEST FALSE)
MESSAGE(STATUS "GoogleTest not available - unit tests will not be built")
ENDIF()
ELSE()
SET(LTS_HAVE_GTEST FALSE)
ENDIF()
CONFIGURE_FILE(CTestCustom.ctest ${CMAKE_BINARY_DIR}/CTestCustom.ctest COPYONLY)
CONFIGURE_FILE(lts-cc.conf ${CMAKE_BINARY_DIR}/lts-cc.conf.distrib COPYONLY)
@@ -418,6 +451,13 @@ if(NOT TARGET Qt6::OpenGL)
message(STATUS "Created stub target for Qt6::OpenGL (library not available)")
endif()
# WebSockets is not part of the component list of the first find_package() above,
# and that call succeeds, so the fallback block that does request it never runs.
# Look the module up on its own before deciding whether a stub is needed.
if(NOT TARGET Qt6::WebSockets)
find_package(Qt6 6.2 COMPONENTS WebSockets QUIET)
endif()
# Stub Qt6::WebSockets target if not available (needed by LtsWebSocket, httq, etc.)
if(NOT TARGET Qt6::WebSockets)
add_library(Qt6::WebSockets INTERFACE IMPORTED)