diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 7 insertions, 8 deletions
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 "" |
