KPN/tests/CMakeLists.txt
Duncan Tourolle 278c122e8f
All checks were successful
🧪 Test / test (push) Successful in 6m8s
Add shared reasource tag to allow coordination of usage
2026-05-09 15:22:27 +02:00

47 lines
1.5 KiB
CMake

cmake_minimum_required(VERSION 3.21)
# ── Catch2 ────────────────────────────────────────────────────────────────────
find_package(Catch2 3 QUIET)
if(NOT Catch2_FOUND)
include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.5.3
)
FetchContent_MakeAvailable(Catch2)
endif()
# ── Google Test ───────────────────────────────────────────────────────────────
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
)
FetchContent_MakeAvailable(googletest)
endif()
# ── Test executable ───────────────────────────────────────────────────────────
add_executable(kpn_tests
test_fixed_string.cpp
test_traits.cpp
test_channel.cpp
test_node.cpp
test_network.cpp
test_static_network.cpp
test_shared_resource.cpp
)
target_link_libraries(kpn_tests PRIVATE
kpn
Catch2::Catch2WithMain
GTest::gtest
)
include(CTest)
include(Catch)
catch_discover_tests(kpn_tests)