From 089843f61d2f2a75581607880961890c48b1da79 Mon Sep 17 00:00:00 2001 From: Maaike Zijderveld Date: Fri, 29 Sep 2023 10:41:10 +0200 Subject: [PATCH] Make it possible to use own logger instead of everest logger (#3) * Make it possible to use own logger instead of everest logger * Update liblog version to 0.2.0 --------- Signed-off-by: Maaike Zijderveld, Alfen Signed-off-by: Kai-Uwe Hermann Co-authored-by: Kai-Uwe Hermann --- dependencies.yaml | 2 +- lib/CMakeLists.txt | 30 ++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/dependencies.yaml b/dependencies.yaml index 11b2fbc..43583a5 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -1,7 +1,7 @@ --- liblog: git: https://github.com/EVerest/liblog.git - git_tag: v0.1.0 + git_tag: v0.2.0 options: ["BUILD_EXAMPLES OFF"] gtest: diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index ba7ba78..514c5fc 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -14,9 +14,35 @@ target_include_directories(evse_security $ ) -target_link_libraries(evse_security - PUBLIC +############# +# Logging configuration +############# +if (EVEREST_CUSTOM_LOGGING_INCLUDE_PATH) + if (NOT EXISTS "${EVEREST_CUSTOM_LOGGING_INCLUDE_PATH}/everest/logging.hpp") + message(FATAL_ERROR "everest/logging.hpp not found in directory ${EVEREST_CUSTOM_LOGGING_INCLUDE_PATH}") + else() + target_include_directories(evse_security + PUBLIC + include + ${EVEREST_CUSTOM_LOGGING_INCLUDE_PATH} + ) + endif() + message(STATUS "Using the following logging header: ${EVEREST_CUSTOM_LOGGING_INCLUDE_PATH}/everest/logging.hpp") +endif() + +if (NOT EVEREST_CUSTOM_LOGGING_INCLUDE_PATH) + target_link_libraries(evse_security + PUBLIC everest::log + ) + message(STATUS "Using the default logging header") +endif() + +############# +# End logging configuration +############# + +target_link_libraries(evse_security PRIVATE OpenSSL::SSL OpenSSL::Crypto