Files
negative-converter/tests/CMakeLists.txt
Christoph K. e5f6fa88fd fix: make project compilable on Ubuntu with Qt 6.4 and no GTest
- Lower Qt6 minimum version requirement from 6.8 to 6.4
- tests/CMakeLists.txt: fall back to FetchContent for GTest if not found
- Add MIT LICENSE file (required by CPack)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 09:52:34 +01:00

62 lines
1.8 KiB
CMake

# Try system GTest first, fall back to FetchContent
find_package(GTest QUIET)
if(NOT GTest_FOUND)
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0
GIT_SHALLOW TRUE
)
set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
endif()
# ──────────────────────────────────────────────
# Pipeline unit tests
# ──────────────────────────────────────────────
add_executable(test_pipeline
test_pipeline.cpp
)
target_link_libraries(test_pipeline PRIVATE
converter_core
GTest::gtest
GTest::gtest_main
)
target_include_directories(test_pipeline PRIVATE
${CMAKE_SOURCE_DIR}/src
)
target_compile_definitions(test_pipeline PRIVATE
TEST_DATA_DIR="${CMAKE_SOURCE_DIR}/import"
)
add_test(NAME PipelineTests COMMAND test_pipeline)
# ──────────────────────────────────────────────
# RawLoader integration tests
# ──────────────────────────────────────────────
add_executable(test_rawloader
test_rawloader.cpp
)
target_link_libraries(test_rawloader PRIVATE
converter_core
GTest::gtest
GTest::gtest_main
)
target_include_directories(test_rawloader PRIVATE
${CMAKE_SOURCE_DIR}/src
)
target_compile_definitions(test_rawloader PRIVATE
TEST_DATA_DIR="${CMAKE_SOURCE_DIR}/import"
)
add_test(NAME RawLoaderTests COMMAND test_rawloader)