MockCoordTrans is a Release 2 GROUP3 target: a header-only static library defined in Lts/Common/CommonUnitTestsPlaceholder/mocks. As a header-only lib it has no source file as a ninja edge input, so the build-closure keep set did not pull its dir in and the prune removed its CMakeLists (ninja: unknown target MockCoordTrans). Restore the dir and its add_subdirectory; the smoke tests inside stay behind their default-OFF options.
35 lines
1.1 KiB
CMake
35 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(CommonUnitTestsPlaceholder)
|
|
|
|
include(FetchContent)
|
|
|
|
option(BUILD_SMOKE_TESTS "Build QtTest smoke tests" OFF)
|
|
option(BUILD_GTEST_SMOKE "Build GTest smoke tests" OFF)
|
|
|
|
add_subdirectory(mocks)
|
|
|
|
if(BUILD_SMOKE_TESTS)
|
|
if(NOT TARGET Qt6::Test)
|
|
find_package(Qt6 REQUIRED COMPONENTS Test)
|
|
endif()
|
|
add_executable(coordTransTests_smoke coordTransTests_smoke.cpp)
|
|
target_link_libraries(coordTransTests_smoke PRIVATE Qt6::Test MockCoordTrans::MockCoordTrans)
|
|
add_test(NAME coordTransTests_smoke COMMAND coordTransTests_smoke)
|
|
endif()
|
|
|
|
if(BUILD_GTEST_SMOKE)
|
|
find_package(GTest QUIET)
|
|
if(NOT GTest_FOUND)
|
|
FetchContent_Declare(
|
|
googletest
|
|
GIT_REPOSITORY https://github.com/google/googletest.git
|
|
GIT_TAG release-1.12.1
|
|
)
|
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
FetchContent_MakeAvailable(googletest)
|
|
endif()
|
|
add_executable(coordTransTests_gtest coordTransTests_gtest.cpp)
|
|
target_link_libraries(coordTransTests_gtest PRIVATE GTest::gtest_main MockCoordTrans::MockCoordTrans)
|
|
add_test(NAME coordTransTests_gtest COMMAND coordTransTests_gtest)
|
|
endif()
|