added _SLS to MD5 functions, added a separate lib for the md5 C code

This commit is contained in:
Erik Frojdh
2021-09-16 14:10:02 +02:00
parent 2ff50750f5
commit 7fd174c21e
8 changed files with 61 additions and 43 deletions

View File

@ -10,8 +10,6 @@ set(SOURCES
src/ZmqSocket.cpp
src/UdpRxSocket.cpp
src/sls_detector_exceptions.cpp
# src/sls_detector_defs.cpp
src/md5.c
src/md5_helper.cpp
)
@ -51,6 +49,20 @@ if(SLS_DEVEL_HEADERS)
)
endif()
# Library for md5 c code that we are using (and potentially other c code)
# Maybe this should be broken out into it's own folder etc.
add_library(md5sls STATIC
src/md5.c
)
target_include_directories(md5sls
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
# Create an object library to avoid building the library twice
add_library(slsSupportObject OBJECT
${SOURCES}
@ -69,7 +81,8 @@ target_link_libraries(slsSupportObject
libzmq
rapidjson
PRIVATE
slsProjectWarnings
slsProjectWarnings
md5sls
)
if (SLS_USE_TESTS)
@ -107,6 +120,9 @@ if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
set_property(TARGET ${SUPPORT_LIBRARY_TARGETS} PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
endif()
list(APPEND SUPPORT_LIBRARY_TARGETS md5sls)
install(TARGETS ${SUPPORT_LIBRARY_TARGETS}
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}