add MbedTLS cmake config.

This commit is contained in:
luocai 2024-11-25 18:42:06 +08:00
parent 3b04085b04
commit 2a85c87105
2 changed files with 8 additions and 10 deletions

View File

@ -1,4 +1,5 @@
find_package(Boost REQUIRED COMPONENTS serialization) find_package(Boost REQUIRED COMPONENTS serialization)
find_package(MbedTLS REQUIRED)
add_library(Encrypt add_library(Encrypt
Encrypt.h Encrypt.cpp Encrypt.h Encrypt.cpp
@ -8,17 +9,12 @@ add_library(Encrypt
target_include_directories(Encrypt target_include_directories(Encrypt
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC ${MBEDTLS_INCLUDE_DIR}
PRIVATE ${Boost_INCLUDE_DIRS} PRIVATE ${Boost_INCLUDE_DIRS}
) )
target_link_directories(Encrypt
PUBLIC ${MBEDTLS_LIBRARY_DIRS}
)
target_link_libraries(Encrypt target_link_libraries(Encrypt
PRIVATE mbedtls PRIVATE MbedTLS::mbedtls
PRIVATE mbedcrypto PRIVATE MbedTLS::mbedcrypto
) )

View File

@ -1,3 +1,5 @@
find_package(MbedTLS REQUIRED)
add_library(Nng add_library(Nng
Buffer.h Buffer.cpp Buffer.h Buffer.cpp
ErrorCode.h ErrorCode.cpp ErrorCode.h ErrorCode.cpp
@ -20,7 +22,7 @@ target_link_directories(Nng
target_link_libraries(Nng target_link_libraries(Nng
PUBLIC nng PUBLIC nng
PUBLIC mbedtls PUBLIC MbedTLS::mbedtls
PUBLIC mbedcrypto PUBLIC MbedTLS::mbedcrypto
PUBLIC mbedx509 PUBLIC MbedTLS::mbedx509
) )