diff --git a/CMakeLists.txt b/CMakeLists.txt index ee958033..ff73e3f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,28 +91,6 @@ if(NOT GIT_VER_HANDLING_OK) set(OBSW_VERSION_REVISION ${OBSW_VERSION_REVISION_IF_GIT_FAILS}) endif() -if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s")) - # Check whether the user has already installed Catch2 first - find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET) - # Not installed, so use FetchContent to download and provide Catch2 - if(NOT Catch2_FOUND) - message(STATUS "${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent") - include(FetchContent) - - FetchContent_Declare( - Catch2 - GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG ${FSFW_CATCH2_LIB_VERSION} - ) - - 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() -endif() - # Set names and variables set(OBSW_NAME ${CMAKE_PROJECT_NAME}) set(WATCHDOG_NAME eive-watchdog) @@ -335,6 +313,29 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(etl) +# Use same Catch2 version as framework +if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s")) + # Check whether the user has already installed Catch2 first + find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET) + # Not installed, so use FetchContent to download and provide Catch2 + if(NOT Catch2_FOUND) + message(STATUS "${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent") + include(FetchContent) + + FetchContent_Declare( + Catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG ${FSFW_CATCH2_LIB_VERSION} + ) + + 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() +endif() + ################################################################################ # Post-Sources preparation ################################################################################