diff options
author | jmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-07-06 09:28:40 +0000 |
---|---|---|
committer | jmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-07-06 09:28:40 +0000 |
commit | 98354fc7944ff3d3b0e6f562371fb710f2e71e85 (patch) | |
tree | f02741fe5ed25a72f49332d552da3c9832d7211d /cmake | |
parent | 60928328de186e311bf326e946d026b5866fafc2 (diff) |
Add detection of rpcap support in libpcap and use it if available.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37914 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindPCAP.cmake | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/cmake/modules/FindPCAP.cmake b/cmake/modules/FindPCAP.cmake index d22f0ba951..7edcb882b2 100644 --- a/cmake/modules/FindPCAP.cmake +++ b/cmake/modules/FindPCAP.cmake @@ -40,16 +40,16 @@ # Find the PCAP includes and library # http://www.tcpdump.org/ # -# The environment variable PCAPDIR allows to specficy where to find +# The environment variable PCAPDIR allows to specficy where to find # libpcap in non standard location. -# +# # PCAP_INCLUDE_DIRS - where to find pcap.h, etc. # PCAP_LIBRARIES - List of libraries when using pcap. # PCAP_FOUND - True if pcap found. IF(EXISTS $ENV{PCAPDIR}) - FIND_PATH(PCAP_INCLUDE_DIR + FIND_PATH(PCAP_INCLUDE_DIR NAMES pcap/pcap.h pcap.h @@ -57,28 +57,28 @@ IF(EXISTS $ENV{PCAPDIR}) $ENV{PCAPDIR} NO_DEFAULT_PATH ) - + FIND_LIBRARY(PCAP_LIBRARY - NAMES + NAMES pcap PATHS $ENV{PCAPDIR} NO_DEFAULT_PATH ) - + ELSE(EXISTS $ENV{PCAPDIR}) - FIND_PATH(PCAP_INCLUDE_DIR + FIND_PATH(PCAP_INCLUDE_DIR NAMES pcap/pcap.h pcap.h ) - + FIND_LIBRARY(PCAP_LIBRARY - NAMES + NAMES pcap ) - + ENDIF(EXISTS $ENV{PCAPDIR}) SET(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) @@ -120,6 +120,14 @@ CHECK_FUNCTION_EXISTS("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) CHECK_FUNCTION_EXISTS("pcap_lib_version" HAVE_PCAP_LIB_VERSION) CHECK_FUNCTION_EXISTS("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD) CHECK_FUNCTION_EXISTS("pcap_free_datalinks" HAVE_PCAP_FREE_DATALINKS) +# Remote pcap checks +CHECK_FUNCTION_EXISTS("pcap_open" H_PCAP_OPEN) +CHECK_FUNCTION_EXISTS("pcap_findalldevs_ex" H_FINDALLDEVS_EX) +CHECK_FUNCTION_EXISTS("pcap_createsrcstr" H_CREATESRCSTR) +if(H_PCAP_OPEN AND H_FINDALLDEVS_EX AND H_CREATESRCSTR) + SET(HAVE_PCAP_REMOTE 1) + SET(HAVE_REMOTE 1) +endif() # reset vars SET(CMAKE_REQUIRED_INCLUDES "") SET(CMAKE_REQUIRED_LIBRARIES "") |