diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-01-26 09:26:17 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-01-26 09:26:30 -0800 |
commit | 2a286c71f36e712b8347397d57ea2858250b72c7 (patch) | |
tree | f30a42719d2c5bc9a9bde1ddcd31b2a30f9a053b /CMakeLists.txt | |
parent | 11d0d3299b30276d1ff689d6d1d466759f316e6c (diff) | |
download | tcpdump-2a286c71f36e712b8347397d57ea2858250b72c7.tar.gz |
Add ${PCAP_LIBRARY_DIRS} to the list of directories with libraries.
Also, use ${PCAP_INCLUDE_DIRS} rather than ${PCAP_INCLUDE_DIR} for the
list of directories with header files (it should be a one-element list,
but do this for consistency), and search for pcap headers *after* we've
found libpcap, so we look in the appropriate directory.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 636ad70e..bd3afb88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,25 +277,6 @@ check_include_file(bitypes.h HAVE_SYS_BITYPES_H) check_include_file(limits.h HAVE_LIMITS_H) # -# Check whether we have pcap/pcap-inttypes.h. -# If we do, we use that to get the C99 types defined. -# -check_include_file(pcap/pcap-inttypes.h HAVE_PCAP_PCAP_INTTYPES_H) - -# -# Check for some headers introduced in later versions of libpcap -# and used by some printers. -# -# Those headers might use the {u_}intN_t types, so we must include -# netdissect-stdinc.h first. -# -cmake_push_check_state() -set(CMAKE_EXTRA_INCLUDE_FILES netdissect-stdinc.h) -check_include_file(pcap/bluetooth.h HAVE_PCAP_BLUETOOTH_H) -check_include_file(pcap/nflog.h HAVE_PCAP_NFLOG_H) -cmake_pop_check_state() - -# # Functions. # check_function_exists(strlcat HAVE_STRLCAT) @@ -415,14 +396,34 @@ include(CheckLibraryExists) # # libpcap/WinPcap. -# First find it, then check for functions in it. +# First, find it. # find_package(PCAP REQUIRED) # +# Check whether we have pcap/pcap-inttypes.h. +# If we do, we use that to get the C99 types defined. +# +check_include_file(pcap/pcap-inttypes.h HAVE_PCAP_PCAP_INTTYPES_H) + +# +# Check for some headers introduced in later versions of libpcap +# and used by some printers. +# +# Those headers might use the {u_}intN_t types, so we must include +# netdissect-stdinc.h first. +# +cmake_push_check_state() +set(CMAKE_EXTRA_INCLUDE_FILES netdissect-stdinc.h) +check_include_file(pcap/bluetooth.h HAVE_PCAP_BLUETOOTH_H) +check_include_file(pcap/nflog.h HAVE_PCAP_NFLOG_H) +cmake_pop_check_state() + +# # Check for various functions in libpcap/WinPcap. # -include_directories(${PCAP_INCLUDE_DIR}) +include_directories(${PCAP_INCLUDE_DIRS}) +link_directories(${PCAP_LIBRARY_DIRS}) cmake_push_check_state() set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES}) |