add nng cmake config.

This commit is contained in:
luocai 2024-11-25 18:50:42 +08:00
parent 2a85c87105
commit c51e11b65e

View File

@ -1,4 +1,5 @@
find_package(MbedTLS REQUIRED) find_package(MbedTLS REQUIRED)
find_package(nng CONFIG REQUIRED)
add_library(Nng add_library(Nng
Buffer.h Buffer.cpp Buffer.h Buffer.cpp
@ -11,17 +12,11 @@ add_library(Nng
target_include_directories(Nng target_include_directories(Nng
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC ${NNG_INCLUDE_DIR}
PUBLIC ${Boost_INCLUDE_DIRS} PUBLIC ${Boost_INCLUDE_DIRS}
) )
target_link_directories(Nng
PUBLIC ${MBEDTLS_LIBRARY_DIRS}
PUBLIC ${NNG_LIBRARY_DIRS}
)
target_link_libraries(Nng target_link_libraries(Nng
PUBLIC nng PUBLIC nng::nng
PUBLIC MbedTLS::mbedtls PUBLIC MbedTLS::mbedtls
PUBLIC MbedTLS::mbedcrypto PUBLIC MbedTLS::mbedcrypto
PUBLIC MbedTLS::mbedx509 PUBLIC MbedTLS::mbedx509