5 # Find the AirPcap library and include files.
7 # This module defines the following variables:
9 # AIRPCAP_INCLUDE_DIR - absolute path to the directory containing airpcap.h.
11 # AIRPCAP_LIBRARY - relative or absolute path to the AirPcap library to
12 # link with. An absolute path is will be used if the
13 # AirPcap library is not located in the compiler's
14 # default search path.
16 # AIRPCAP_FOUND - TRUE if the AirPcap library *and* header are found.
18 # Hints and Backward Compatibility
19 # ================================
21 # To tell this module where to look, a user may set the environment variable
22 # AirPcap_ROOT to point cmake to the *root* of a directory with include and
23 # lib subdirectories for airpcap.dll (e.g Airpcap_Devpack).
24 # Alternatively, AirPcap_ROOT may also be set from the CMake command
25 # line or GUI (e.g cmake -DAirPcap_ROOT=C:\path\to\airpcap_sdk [...])
28 # The 64-bit airpcap.lib is located under /x64
29 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
31 # For the WinPcap and Npcap SDKs, the Lib subdirectory of the top-level
32 # directory contains 32-bit libraries; the 64-bit libraries are in the
35 # The only way to *FORCE* CMake to look in the Lib/x64 directory
36 # without searching in the Lib directory first appears to be to set
37 # CMAKE_LIBRARY_ARCHITECTURE to "x64".
39 # In newer versions of CMake, CMAKE_LIBRARY_ARCHITECTURE is set according to
40 # the language, e.g., CMAKE_<LANG>_LIBRARY_ARCHITECTURE. So, set the new
41 # variable, CMAKE_C_LIBRARY_ARCHITECTURE, so that CMAKE_LIBRARY_ARCHITECTURE
42 # inherits the correct value.
44 set(CMAKE_C_LIBRARY_ARCHITECTURE "x64")
45 set(CMAKE_LIBRARY_ARCHITECTURE "x64")
49 find_path(AIRPCAP_INCLUDE_DIR airpcap.h
54 find_library(AIRPCAP_LIBRARY
58 # Set AIRPCAP_FOUND to TRUE if AIRPCAP_INCLUDE_DIR and AIRPCAP_LIBRARY are TRUE.
59 include(FindPackageHandleStandardArgs)
60 find_package_handle_standard_args(AIRPCAP
66 mark_as_advanced(AIRPCAP_INCLUDE_DIR AIRPCAP_LIBRARY)
68 set(AIRPCAP_INCLUDE_DIRS ${AIRPCAP_INCLUDE_DIR})
69 set(AIRPCAP_LIBRARIES ${AIRPCAP_LIBRARY})