From 9b4cbc6ba3f8059278a20a4893780717851ce8e4 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 21 Apr 2026 13:06:35 +0200 Subject: build: clean up configuration --- CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 002ab0c..972422c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,8 @@ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules") include("ElfTransformations") include("GenerateBootableIso") +include("CTest") +include("EnableCoverage") #[============================================================================[ # External Dependencies @@ -18,7 +20,7 @@ include("GenerateBootableIso") include("FetchContent") -if (NOT CMAKE_CROSSCOMPILING) +if (BUILD_TESTING) FetchContent_Declare( "Catch2" URL "https://github.com/catchorg/Catch2/archive/refs/tags/v3.7.1.tar.gz" @@ -28,6 +30,9 @@ if (NOT CMAKE_CROSSCOMPILING) ) FetchContent_MakeAvailable("Catch2") + + find_package("Catch2") + include("Catch") endif() #[============================================================================[ @@ -92,13 +97,7 @@ endif() # Build Host Testing #]============================================================================] -if(NOT CMAKE_CROSSCOMPILING) - include("EnableCoverage") - - enable_testing() - find_package("Catch2") - include("Catch") - +if(BUILD_TESTING) if(TARGET "Catch2" AND TARGET "Catch2WithMain") set_target_properties("Catch2" "Catch2WithMain" PROPERTIES C_CLANG_TIDY "" -- cgit v1.2.3