| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Most of the time this probably won't be an issue on UN*Xes, but it'll
probably be an issue on Windows.
|
| |
|
|
|
|
|
|
|
| |
We have messages for pkg-config and for the old-fashioned search; print
a message if pkg-config failed but we found pcap-config.
Fix the suppression of messages with a QUIET argument.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we have pkg-config, *and* it has .pc files for libpcap, use it to get
the C compiler flags and linker flags for libpcap.
find_library() sets a cache variable; when we're looping over libraries,
trying to find their full paths, we really want the variable to act as a
local variable, as we're looking up different libraries, so unset it
after we're finished processing a particular library.
When we're searching for static libraries, save the current value of
CMAKE_FIND_LIBRARY_SUFFIXES, set it to ".a", and then restore it when
we're done. Don't use cmake_push_check_state() for that, as
CMAKE_FIND_LIBRARY_SUFFIXES is *not* one of the variables that it's
guaranteed to save and restore.
|
| |
|
|
|
|
|
|
| |
It should set PCAP_INCLUDE_DIRS, PCAP_LIBRARIES and
PCAP_STATIC_LIBRARIES, plural. Do that, and don't bother setting
PCAP_INCLUDE_DIR or PCAP_LIBRARY.
|
| |
|
|
|
|
| |
Quote it in the string(REGEX REPLACE) call.
|
| |
|
|
|
|
|
|
|
| |
Also, while there may not be a convention for "look for package XXX
here", there is a convention for "look for stuff here" - put "here" in
CMAKE_PREFIX_PATH. So don't use PCAP_DLL_DIR, just let find_path() and
find_library() search where you tell it (on Windows *or* UN*X).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
CMake *hates* that. -L considered harmful, I guess (and I don't know
how that's done with tools other than UN*X linkers - do all of them
support an equivalent to -L?).
This should fix the checks for pcap functions to look in the library we
found.
|
|
|
|
| |
Also, provide support for linking statically with pcap.
|
|
|
|
| |
That appears to be the convention.
|
|
|
|
| |
Put the optional libraries after libpcap, which is *not* optional.
|
|
Work in progress; there's more to be done.
|