Kylin/Encrypt/CMakeLists.txt
2024-05-28 15:18:38 +02:00

39 lines
983 B
CMake

find_package(Boost REQUIRED COMPONENTS serialization)
add_library(Encrypt
Encrypt.h Encrypt.cpp
MessageDigest.h MessageDigest.cpp
SecureHashAlgorithm.h SecureHashAlgorithm.cpp
)
target_include_directories(Encrypt
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${Boost_INCLUDE_DIRS}
)
set(MBEDTLS_VERSION 3.4.0)
add_library(mbedtls-${MBEDTLS_VERSION}
mbedtls-${MBEDTLS_VERSION}/library/md.c
mbedtls-${MBEDTLS_VERSION}/library/md5.c
mbedtls-${MBEDTLS_VERSION}/library/sha1.c
mbedtls-${MBEDTLS_VERSION}/library/sha256.c
mbedtls-${MBEDTLS_VERSION}/library/sha512.c
mbedtls-${MBEDTLS_VERSION}/library/ripemd160.c
mbedtls-${MBEDTLS_VERSION}/library/platform_util.c
)
target_include_directories(mbedtls-${MBEDTLS_VERSION}
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/mbedtls-${MBEDTLS_VERSION}/include
)
target_link_libraries(Encrypt
PUBLIC mbedtls-${MBEDTLS_VERSION}
)
if(UNIX)
target_compile_options(Encrypt
PRIVATE -fPIC
)
endif()