#
# Try to find libpcap.
#
+# To tell this module where to look, a user may set the environment variable
+# PCAP_ROOT to point cmake to the *root* of a directory with include and
+# lib subdirectories for pcap.dll (e.g WpdPack or npcap-sdk).
+# Alternatively, PCAP_ROOT may also be set from cmake command line or GUI
+# (e.g cmake -DPCAP_ROOT=C:\path\to\pcap [...])
+#
if(WIN32)
#
#
set(CMAKE_LIBRARY_ARCHITECTURE "x64")
endif()
- find_library(PCAP_LIBRARY pcap wpcap)
+ find_library(PCAP_LIBRARY NAMES pcap wpcap)
#
# Do the standard arg processing, including failing if it's a
# libpcap isn't available - not all systems ship pkg-config, and
# libpcap didn't have .pc files until libpcap 1.9.0.
#
- if(PCAP_FIND_QUIET)
+ if(PCAP_FIND_QUIETLY)
set(_quiet "QUIET")
endif()
# First, try pkg-config.
#
find_package(PkgConfig)
- pkg_search_module(CONFIG_PCAP ${QUIET} libpcap)
+ pkg_search_module(CONFIG_PCAP ${_quiet} libpcap)
if(NOT CONFIG_PCAP_FOUND)
#
if(PCAP_CONFIG)
#
# We have pcap-config; use it.
+ #
+ if(NOT "${_quiet}" STREQUAL "QUIET")
+ message(STATUS "Found pcap-config")
+ endif()
+
#
# if this is macOS or some other Darwin-based OS, check whether
# it's the system-supplied one.
endif()
endif()
endforeach()
-
+
#
# Now, get the library directories and libraries for dynamic linking.
#