From 2e0cb27987c7d004b7d13a6dab9881b5467864c5 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Thu, 12 Feb 2026 13:13:36 -0700 Subject: [PATCH] Add dynamic catch 2 install --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8624a08..8300ed6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,15 @@ endif() if(WARPPIPE_BUILD_TESTS) enable_testing() - find_package(Catch2 3 REQUIRED) + find_package(Catch2 3 QUIET) + if(NOT Catch2_FOUND) + FetchContent_Declare(Catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG v3.5.2 + ) + FetchContent_MakeAvailable(Catch2) + list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) + endif() add_executable(warppipe_tests tests/warppipe_tests.cpp) target_link_libraries(warppipe_tests PRIVATE warppipe Catch2::Catch2WithMain) target_compile_definitions(warppipe PRIVATE WARPPIPE_TESTING)