diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bcd3ec..3e92693 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,22 +124,22 @@ add_subdirectory(${COMMON_PATH}) # ############################################################################## # Check whether the user has already installed ETL first -# find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET) -# Not installed, so use FetchContent to download and provide etl -# if(NOT etl_FOUND) -message( - STATUS - "No ETL installation was found with find_package. Installing and providing " - "etl with FindPackage") -include(FetchContent) +find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET) + # Not installed, so use FetchContent to download and provide etl + if(NOT etl_FOUND) + message( + STATUS + "No ETL installation was found with find_package. Installing and providing " + "etl with FindPackage") + include(FetchContent) -FetchContent_Declare( - etl - GIT_REPOSITORY https://github.com/ETLCPP/etl - GIT_TAG ${FSFW_ETL_LIB_VERSION}) + FetchContent_Declare( + etl + GIT_REPOSITORY https://github.com/ETLCPP/etl + GIT_TAG ${FSFW_ETL_LIB_VERSION}) -list(APPEND FSFW_FETCH_CONTENT_TARGETS etl) -# endif() + list(APPEND FSFW_FETCH_CONTENT_TARGETS etl) +endif() # The documentation for FetchContent recommends declaring all the dependencies # before making them available. We make all declared dependency available here