From a462630423677d19f7c56b02e2df1cbcda1257df Mon Sep 17 00:00:00 2001 From: Florian Reimold <11774314+FlorianReimold@users.noreply.github.com> Date: Tue, 24 Jan 2023 11:22:11 +0100 Subject: [PATCH] CMake: improved udpcapConfig-XXX.cmake with find_dependency (#6) - Replaced find_package with find_dependency call that is designed to be used in Package configuration files - Replaced configured install-dir with a lookup in the CURRENT_LIST_DIR --- udpcap/cmake/udpcapConfig-shared.cmake.in | 2 +- udpcap/cmake/udpcapConfig-static.cmake.in | 7 ++++--- udpcap/version.cmake | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/udpcap/cmake/udpcapConfig-shared.cmake.in b/udpcap/cmake/udpcapConfig-shared.cmake.in index 5cf7485..401c219 100644 --- a/udpcap/cmake/udpcapConfig-shared.cmake.in +++ b/udpcap/cmake/udpcapConfig-shared.cmake.in @@ -1,3 +1,3 @@ @PACKAGE_INIT@ -INCLUDE("@PACKAGE_UDPCAP_INSTALL_CMAKE_DIR@/udpcapTargets.cmake") \ No newline at end of file +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/udpcapTargets.cmake") diff --git a/udpcap/cmake/udpcapConfig-static.cmake.in b/udpcap/cmake/udpcapConfig-static.cmake.in index 7d926cc..5b90109 100644 --- a/udpcap/cmake/udpcapConfig-static.cmake.in +++ b/udpcap/cmake/udpcapConfig-static.cmake.in @@ -1,6 +1,7 @@ @PACKAGE_INIT@ -INCLUDE("@PACKAGE_UDPCAP_INSTALL_CMAKE_DIR@/udpcapTargets.cmake") +include(CMakeFindDependencyMacro) +find_dependency(npcap) +find_dependency(pcapplusplus) -find_package(npcap REQUIRED) -find_package(pcapplusplus REQUIRED) \ No newline at end of file +INCLUDE("${CMAKE_CURRENT_LIST_DIR}/udpcapTargets.cmake") diff --git a/udpcap/version.cmake b/udpcap/version.cmake index 0b6e531..76c4b7b 100644 --- a/udpcap/version.cmake +++ b/udpcap/version.cmake @@ -1,3 +1,3 @@ set(UDPCAP_VERSION_MAJOR 1) set(UDPCAP_VERSION_MINOR 0) -set(UDPCAP_VERSION_PATCH 1) +set(UDPCAP_VERSION_PATCH 2)