From 2a85c871058fef3e345a05a946fe496fac6a7c11 Mon Sep 17 00:00:00 2001 From: luocai Date: Mon, 25 Nov 2024 18:42:06 +0800 Subject: [PATCH] add MbedTLS cmake config. --- Encrypt/CMakeLists.txt | 10 +++------- Nng/CMakeLists.txt | 8 +++++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Encrypt/CMakeLists.txt b/Encrypt/CMakeLists.txt index e929cc6..be5064a 100644 --- a/Encrypt/CMakeLists.txt +++ b/Encrypt/CMakeLists.txt @@ -1,4 +1,5 @@ find_package(Boost REQUIRED COMPONENTS serialization) +find_package(MbedTLS REQUIRED) add_library(Encrypt Encrypt.h Encrypt.cpp @@ -8,17 +9,12 @@ add_library(Encrypt target_include_directories(Encrypt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} - PUBLIC ${MBEDTLS_INCLUDE_DIR} PRIVATE ${Boost_INCLUDE_DIRS} ) -target_link_directories(Encrypt - PUBLIC ${MBEDTLS_LIBRARY_DIRS} -) - target_link_libraries(Encrypt - PRIVATE mbedtls - PRIVATE mbedcrypto + PRIVATE MbedTLS::mbedtls + PRIVATE MbedTLS::mbedcrypto ) diff --git a/Nng/CMakeLists.txt b/Nng/CMakeLists.txt index 74f5d77..56d0302 100644 --- a/Nng/CMakeLists.txt +++ b/Nng/CMakeLists.txt @@ -1,3 +1,5 @@ +find_package(MbedTLS REQUIRED) + add_library(Nng Buffer.h Buffer.cpp ErrorCode.h ErrorCode.cpp @@ -20,7 +22,7 @@ target_link_directories(Nng target_link_libraries(Nng PUBLIC nng - PUBLIC mbedtls - PUBLIC mbedcrypto - PUBLIC mbedx509 + PUBLIC MbedTLS::mbedtls + PUBLIC MbedTLS::mbedcrypto + PUBLIC MbedTLS::mbedx509 ) \ No newline at end of file