From c1be1fe2320eed167e808eecf3e582c87b688cde Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 26 Apr 2022 20:06:26 +0200 Subject: [PATCH] update CMakeLists.txt etl handling --- CMakeLists.txt | 34 +++++++++---------- .../devicehandlers/MgmLIS3MDLHandler.cpp | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2354f504..337a56f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.13) +project(${LIB_FSFW_NAME}) set(FSFW_VERSION_IF_GIT_FAILS 4) set(FSFW_SUBVERSION_IF_GIT_FAILS 0) @@ -60,7 +61,6 @@ set(LIB_FSFW_NAME fsfw) set(FSFW_TEST_TGT fsfw-tests) set(FSFW_DUMMY_TGT fsfw-dummy) -project(${LIB_FSFW_NAME}) add_library(${LIB_FSFW_NAME}) set(FSFW_GIT_VER_HANDLING_OK FALSE) @@ -98,7 +98,7 @@ endif() if(FSFW_BUILD_UNITTESTS) message(STATUS "${MSG_PREFIX} Building the FSFW unittests in addition to the static library") # Check whether the user has already installed Catch2 first - find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} QUIET) + 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") @@ -135,23 +135,23 @@ endif() message(STATUS "Finding and/or providing etl library with version ${FSFW_ETL_LIB_MAJOR_VERSION}") # 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} CONFIG 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 FetchContent" +) +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(${FSFW_ETL_LIB_NAME}) +# endif() set(FSFW_CORE_INC_PATH "inc") @@ -414,7 +414,7 @@ target_compile_options(${LIB_FSFW_NAME} PRIVATE ) target_link_libraries(${LIB_FSFW_NAME} PRIVATE - ${FSFW_ETL_LIB_NAME} + etl ${FSFW_ADDITIONAL_LINK_LIBS} ) diff --git a/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp b/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp index a887934d..a13ae791 100644 --- a/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp +++ b/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.cpp @@ -375,7 +375,7 @@ float MgmLIS3MDLHandler::getSensitivityFactor(MGMLIS3MDL::Sensitivies sens) { ReturnValue_t MgmLIS3MDLHandler::enableTemperatureSensor(const uint8_t *commandData, size_t commandDataLen) { - if(commandData == nullptr) { + if (commandData == nullptr) { return INVALID_COMMAND_PARAMETER; } triggerEvent(CHANGE_OF_SETUP_PARAMETER);