Kylin/Encrypt/CMakeLists.txt

39 lines
984 B
CMake
Raw Normal View History

2023-08-01 13:54:17 +08:00
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
PRIVATE mbedtls-${MBEDTLS_VERSION}
)
if(UNIX)
target_compile_options(Encrypt
PRIVATE -fPIC
)
endif()