1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
From: Matthias Geiger <matthias.geiger1024@tutanota.de>
Date: Sat, 28 Mar 2026 23:43:57 +0100
Subject: Allow fully offline build
Forwarded: not-needed
Last-Update: 2023-11-06
---
test/CMakeLists.txt | 36 ------------------------------------
1 file changed, 36 deletions(-)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index ec0fd05..5f05c1c 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -14,41 +14,6 @@ set(CMAKE_CXX_EXTENSIONS OFF)
if (${CMAKE_CXX_STANDARD} GREATER 11)
find_package(Catch2 3 QUIET)
endif()
-if (NOT Catch2_FOUND)
- find_package(Catch2 2...<3 QUIET)
- if (NOT Catch2_FOUND)
- set(CATCH_DIR ${CMAKE_CURRENT_BINARY_DIR}/catch)
- if (NOT EXISTS "${CATCH_DIR}/catch2/catch.hpp")
- if (NOT EXISTS ${CATCH_DIR})
- FILE(MAKE_DIRECTORY "${CATCH_DIR}/catch2")
- endif()
- file(
- DOWNLOAD
- https://github.com/catchorg/Catch2/releases/download/v2.13.7/catch.hpp ${CATCH_DIR}/catch2/catch.hpp
- STATUS
- status
- LOG
- log
- )
- list(GET status 0 status_code)
- list(GET status 1 status_string)
-
- if(NOT status_code EQUAL 0)
- message(FATAL_ERROR "error downloading catch: ${status_string}"
- "${log}")
- endif()
- endif()
- add_library(Catch2 INTERFACE)
- add_library(Catch2::Catch2 ALIAS Catch2)
- target_include_directories(Catch2 INTERFACE "${CATCH_DIR}")
- set(Catch2_VERSION_MAJOR 2)
- endif()
-endif()
-if (TARGET Catch2::Catch2WithMain)
- set(CATCH2_MAIN Catch2::Catch2WithMain)
- add_compile_definitions(CATCH2_MAIN)
-endif()
-add_compile_definitions(CATCH2_VERSION=${Catch2_VERSION_MAJOR})
# Assumptions:
# Clang and GNU compilers run on Linux or Linux-like platforms.
@@ -244,7 +209,6 @@ target_link_libraries(
PUBLIC
trompeloeil
${CATCH2_MAIN}
- Catch2::Catch2
)
|