]> The Tcpdump Group git mirrors - tcpdump/commit
Redo the checks for libpcap.
authorGuy Harris <[email protected]>
Mon, 29 Apr 2019 18:55:27 +0000 (11:55 -0700)
committerGuy Harris <[email protected]>
Mon, 29 Apr 2019 18:55:27 +0000 (11:55 -0700)
commit87207f2b1aeb08fd2b2365d22811b06d6c5724f2
tree3a88995c961d66fa4e668941eb9ec051dc8d1a09
parent09e38732e77d97e926165088c8518f6560847744
Redo the checks for libpcap.

On Windows, don't bother with pkg-config or pcap-config.  We make no
effort, in libpcap, to make them work on Windows, we don't install the
.pc files or pcap-config on Windows with the CMake build, and neither
WinPcap nor Npcap install them.

On UN*X:

For pkg-config and pcap-config, set variables named CONFIG_PCAP_xxx.
pkg-config's xxx_LIBRARIES and xxx_STATIC_LIBRARIES variables have only
library names, not library full paths, so we need to use find_library()
to convert them to full paths.  For pcap-config, generate
library-name-only CONFIG_PCAP_LIBRARIES and CONFIG_PCAP_STATIC_LIBRARIES
variables, as well as CONFIG_PCAP_FOUND.

If CONFIG_PCAP_FOUND is true, meaning that either pkg-config or
pcap-config succeeded, copy CONFIG_PCAP_INCLUDE_DIRS to
PCAP_INCLUDE_DIRS, iterate over CONFIG_PCAP_LIBRARIES and
CONFIG_PCAP_STATIC_LIBRARIES to generate full paths for all of the
libraries and put them in PCAP_LIBRARIES and PCAP_STATIC_LIBRARIES, and
set PCAP_FOUND.

If CONFIG_PCAP_FOUND is false, search for headers and libraries
ourselves.
cmake/Modules/FindPCAP.cmake