diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c160fe5..32bf2324 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,20 +139,6 @@ set(FSFW_ADDITIONAL_INC_PATHS # Check whether the user has already installed Catch2 first find_package(Catch2 3) -# Not installed, so use FetchContent to download and provide Catch2 -if(NOT Catch2_FOUND) - include(FetchContent) - - FetchContent_Declare( - Catch2 - GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v3.0.0-preview4 - ) - - FetchContent_MakeAvailable(Catch2) - #fixes regression -preview4, to be confirmed in later releases - set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "") -endif() ################################################################################ # Executable and Sources @@ -182,6 +168,24 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(COMPILER_FLAGS "/permissive-") endif() +# Not installed, so use FetchContent to download and provide Catch2 +if(NOT Catch2_FOUND) + include(FetchContent) + + FetchContent_Declare( + Catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG v3.0.0-preview4 + ) + + FetchContent_MakeAvailable(Catch2) + #fixes regression -preview4, to be confirmed in later releases + set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "") + set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true") + set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true") +endif() + + add_library(${LIB_EIVE_MISSION})