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)