From c80f06fbcb81f303ded1a08d23032429f61067c3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 27 Apr 2022 09:08:17 +0200 Subject: [PATCH 1/5] hotfix for ETL lib dep --- CMakeLists.txt | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8ca812e..fd3cee36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,23 +108,23 @@ endif() message(STATUS "Finding and/or providing ETL library") # Check whether the user has already installed ETL first -find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET) +# find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET) # Not installed, so use FetchContent to download and provide etl -if(NOT ${FSFW_ETL_LIB_NAME}_FOUND) - message(STATUS - "No ETL installation was found with find_package. Installing and providing " - "etl with FindPackage" - ) - include(FetchContent) +# if(NOT ${FSFW_ETL_LIB_NAME}_FOUND) +message(STATUS + "No ETL installation was found with find_package. Installing and providing " + "etl with FindPackage" +) +include(FetchContent) - FetchContent_Declare( - ${FSFW_ETL_LIB_NAME} - GIT_REPOSITORY https://github.com/ETLCPP/etl - GIT_TAG ${FSFW_ETL_LIB_VERSION} - ) +FetchContent_Declare( + ${FSFW_ETL_LIB_NAME} + GIT_REPOSITORY https://github.com/ETLCPP/etl + GIT_TAG ${FSFW_ETL_LIB_VERSION} +) - FetchContent_MakeAvailable(etl) -endif() +FetchContent_MakeAvailable(etl) +# endif() set(FSFW_CORE_INC_PATH "inc") From 64f0166b64ef7c10f415e32d167518eeb4c89e8f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 27 Apr 2022 09:16:52 +0200 Subject: [PATCH 2/5] hotfix for new ETL dependency --- CMakeLists.txt | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd3cee36..a74e58f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set(FSFW_ETL_LIB_MAJOR_VERSION 20 CACHE STRING set(FSFW_ETL_LIB_VERSION ${FSFW_ETL_LIB_MAJOR_VERSION}.27.2 CACHE STRING "ETL library exact version requirement" ) +set(FSFW_ETL_LINK_TARGET etl::etl) set(FSFW_CATCH2_LIB_MAJOR_VERSION 3 CACHE STRING "Catch2 library major version requirement" @@ -108,23 +109,24 @@ endif() message(STATUS "Finding and/or providing ETL library") # Check whether the user has already installed ETL first -# find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET) +find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET) # Not installed, so use FetchContent to download and provide etl -# if(NOT ${FSFW_ETL_LIB_NAME}_FOUND) -message(STATUS - "No ETL installation was found with find_package. Installing and providing " - "etl with FindPackage" -) -include(FetchContent) +if(NOT ${FSFW_ETL_LIB_NAME}_FOUND) + message(STATUS + "No ETL installation was found with find_package. Installing and providing " + "etl with FindPackage" + ) + include(FetchContent) -FetchContent_Declare( - ${FSFW_ETL_LIB_NAME} - GIT_REPOSITORY https://github.com/ETLCPP/etl - GIT_TAG ${FSFW_ETL_LIB_VERSION} -) + FetchContent_Declare( + ${FSFW_ETL_LIB_NAME} + GIT_REPOSITORY https://github.com/ETLCPP/etl + GIT_TAG ${FSFW_ETL_LIB_VERSION} + ) -FetchContent_MakeAvailable(etl) -# endif() + FetchContent_MakeAvailable(etl) + add_library(${FSFW_ETL_LINK_TARGET} ALIAS etl) +endif() set(FSFW_CORE_INC_PATH "inc") @@ -387,7 +389,7 @@ target_compile_options(${LIB_FSFW_NAME} PRIVATE ) target_link_libraries(${LIB_FSFW_NAME} PRIVATE - ${FSFW_ETL_LIB_NAME} + ${FSFW_ETL_LINK_TARGET} ${FSFW_ADDITIONAL_LINK_LIBS} ) From 17e609c3a599090a3aea5518c2f5d33412e90fcf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 27 Apr 2022 09:37:11 +0200 Subject: [PATCH 3/5] some more var replacements --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a74e58f4..9d9c1891 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,8 +124,8 @@ if(NOT ${FSFW_ETL_LIB_NAME}_FOUND) GIT_TAG ${FSFW_ETL_LIB_VERSION} ) - FetchContent_MakeAvailable(etl) - add_library(${FSFW_ETL_LINK_TARGET} ALIAS etl) + FetchContent_MakeAvailable(${FSFW_ETL_LIB_NAME}) + add_library(${FSFW_ETL_LINK_TARGET} ALIAS ${FSFW_ETL_LIB_NAME}) endif() set(FSFW_CORE_INC_PATH "inc") From b00d83cb1a20c2fd61343ba19f93173e789d69e4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 27 Apr 2022 09:41:16 +0200 Subject: [PATCH 4/5] bump ETL revision --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d9c1891..705d5cc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) set(FSFW_ETL_LIB_MAJOR_VERSION 20 CACHE STRING "ETL library major version requirement" ) -set(FSFW_ETL_LIB_VERSION ${FSFW_ETL_LIB_MAJOR_VERSION}.27.2 CACHE STRING +set(FSFW_ETL_LIB_VERSION ${FSFW_ETL_LIB_MAJOR_VERSION}.27.3 CACHE STRING "ETL library exact version requirement" ) set(FSFW_ETL_LINK_TARGET etl::etl) From 6aa72892edf060798ce7665521e15f825cb94ab5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 27 Apr 2022 21:53:57 +0200 Subject: [PATCH 5/5] clean usage of FetchContent_MakeAvailable --- CMakeLists.txt | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 705d5cc6..a7fa1712 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,9 +77,7 @@ if(FSFW_BUILD_UNITTESTS) 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 "") + list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2) endif() set(FSFW_CONFIG_PATH tests/src/fsfw_tests/unit/testcfg) @@ -124,8 +122,21 @@ if(NOT ${FSFW_ETL_LIB_NAME}_FOUND) GIT_TAG ${FSFW_ETL_LIB_VERSION} ) - FetchContent_MakeAvailable(${FSFW_ETL_LIB_NAME}) - add_library(${FSFW_ETL_LINK_TARGET} ALIAS ${FSFW_ETL_LIB_NAME}) + list(APPEND FSFW_FETCH_CONTENT_TARGETS ${FSFW_ETL_LIB_NAME}) +endif() + +# The documentation for FetchContent recommends declaring all the dependencies +# before making them available. We make all declared dependency available here +# after their declaration +if(FSFW_FETCH_CONTENT_TARGETS) + FetchContent_MakeAvailable(${FSFW_FETCH_CONTENT_TARGETS}) + if(TARGET ${FSFW_ETL_LIB_NAME}) + add_library(${FSFW_ETL_LINK_TARGET} ALIAS ${FSFW_ETL_LIB_NAME}) + endif() + if(TARGET Catch2) + # Fixes regression -preview4, to be confirmed in later releases + set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "") + endif() endif() set(FSFW_CORE_INC_PATH "inc")