Skip to content

Commit

Permalink
Add option to provide a custom logging library, similar to libocpp
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Emmers <[email protected]>
  • Loading branch information
marcemmers committed May 16, 2024
1 parent 4330ce2 commit 18ec298
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/evse_security/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ target_include_directories(evse_security
#############
# Logging configuration
#############
if (EVEREST_CUSTOM_LOGGING_INCLUDE_PATH)
if (EVEREST_CUSTOM_LOGGING_LIBRARY)
if(NOT TARGET ${EVEREST_CUSTOM_LOGGING_LIBRARY})
message(FATAL_ERROR "${EVEREST_CUSTOM_LOGGING_LIBRARY} is not a valid library")
else()
target_link_libraries(evse_security
PUBLIC
${EVEREST_CUSTOM_LOGGING_LIBRARY}
)
message(STATUS "Using custom logging library: ${EVEREST_CUSTOM_LOGGING_LIBRARY}")
endif()
elseif (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()
Expand Down

0 comments on commit 18ec298

Please sign in to comment.