summaryrefslogtreecommitdiff
path: root/cmake/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Add a comment about how to tell this where to find pcap.Guy Harris2020-02-041-0/+6
| | | | | Most of the time this probably won't be an issue on UN*Xes, but it'll probably be an issue on Windows.
* Remove trailing spacesFrancois-Xavier Le Bail2019-08-161-1/+1
|
* Add a message for pcap-config, and suppress messages with QUIET.Guy Harris2019-04-291-2/+7
| | | | | | | 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.
* To search for a library under multiple names, say "NAMES name1 name2 ...".Guy Harris2019-04-291-1/+1
|
* Redo the checks for libpcap.Guy Harris2019-04-291-191/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Use pkg-config if we can. Clean up some CMake stuff.Guy Harris2019-04-261-124/+192
| | | | | | | | | | | | | | | | 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.
* Fix tpo in previous commit.Guy Harris2019-04-261-1/+1
|
* Clean up the find module for libpcap.Guy Harris2019-04-251-28/+27
| | | | | | 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.
* Try to find the 64-bit libraries in a 64-bit build.Guy Harris2018-09-131-0/+16
|
* Handle the output of pcap-config --cflags being empty.Guy Harris2018-07-121-1/+1
| | | | Quote it in the string(REGEX REPLACE) call.
* Fixtypo.Guy Harris2018-01-281-1/+1
|
* On Windows, if we don't find libpcap, look for libwpcap.Guy Harris2018-01-281-19/+14
| | | | | | | 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).
* Add support for PCAP_DLL_DIR as a hint on Windows.Guy Harris2018-01-281-10/+30
|
* Set PCAP_INCLUDE_DIRS as well as PCAP_INCLUDE_DIR.Guy Harris2018-01-261-1/+6
|
* Don't do "here's the directories in which to look for libraries".Guy Harris2018-01-261-21/+35
| | | | | | | | | 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.
* Use pcap-config if we have it.Guy Harris2018-01-261-7/+88
| | | | Also, provide support for linking statically with pcap.
* Set XXX_INCLUDE_DIRS and XXX_LIBRARIES in find modules.Guy Harris2018-01-233-0/+9
| | | | That appears to be the convention.
* Add libcrypto checks.Guy Harris2018-01-221-0/+21
| | | | Put the optional libraries after libpcap, which is *not* optional.
* Initial CMake support.Guy Harris2018-01-212-0/+42
Work in progress; there's more to be done.