aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindmbedTLS.cmake2
-rw-r--r--cmake/NNGHelpers.cmake10
2 files changed, 10 insertions, 2 deletions
diff --git a/cmake/FindmbedTLS.cmake b/cmake/FindmbedTLS.cmake
index f01039d6..804a0392 100644
--- a/cmake/FindmbedTLS.cmake
+++ b/cmake/FindmbedTLS.cmake
@@ -82,5 +82,5 @@ endif ()
string(REGEX REPLACE ".*MBEDTLS_VERSION_STRING[\t ]+\"(.*)\"" "\\1" MBEDTLS_VERSION ${_MBEDTLS_VERLINE})
find_package_handle_standard_args(mbedTLS
- REQUIRED_VARS MBEDTLS_TLS_LIBRARY MBEDTLS_CRYPTO_LIBRARY MBEDTLS_X509_LIBRARY MBEDTLS_INCLUDE_DIR VERSION_VAR MBEDTLS_VERSION)
+ REQUIRED_VARS MBEDTLS_TLS_LIBRARY MBEDTLS_CRYPTO_LIBRARY MBEDTLS_X509_LIBRARY MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARIES VERSION_VAR MBEDTLS_VERSION)
diff --git a/cmake/NNGHelpers.cmake b/cmake/NNGHelpers.cmake
index d7596827..d97d800c 100644
--- a/cmake/NNGHelpers.cmake
+++ b/cmake/NNGHelpers.cmake
@@ -41,6 +41,14 @@ function(nng_defines)
target_compile_definitions(nng_private INTERFACE ${ARGN})
endfunction()
+# nng_find_package looks up required package and adds dependency to the cmake config.
+macro(nng_find_package PACKAGE_NAME)
+ find_package(${PACKAGE_NAME} REQUIRED)
+ list(APPEND NNG_PKGS ${PACKAGE_NAME})
+ list(REMOVE_DUPLICATES NNG_PKGS)
+ set(NNG_PKGS ${NNG_PKGS} CACHE INTERNAL "nng package dependencies" FORCE)
+endmacro()
+
# nng_link_libraries adds link dependencies to the libraries.
function(nng_link_libraries)
target_link_libraries(nng PRIVATE ${ARGN})
@@ -156,4 +164,4 @@ endfunction(nng_check_struct_member)
macro(nng_directory DIR)
set(NNG_TEST_PREFIX ${NNG_TEST_PREFIX}.${DIR})
-endmacro(nng_directory) \ No newline at end of file
+endmacro(nng_directory)