aboutsummaryrefslogtreecommitdiff
path: root/cmake/NNGHelpers.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/NNGHelpers.cmake')
-rw-r--r--cmake/NNGHelpers.cmake10
1 files changed, 9 insertions, 1 deletions
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)