diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-09-13 16:26:39 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-09-13 16:26:39 -0700 |
commit | e5c7dcdc04d381db472bd72bd61e8e59d70b26d7 (patch) | |
tree | 7d0839eab62161d20639faf56e3ce9ca0547c592 /cmake | |
parent | 5d5a9021b58590badb6b8e9ba756d01d1c639d0c (diff) | |
download | tcpdump-e5c7dcdc04d381db472bd72bd61e8e59d70b26d7.tar.gz |
Try to find the 64-bit libraries in a 64-bit build.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/FindPCAP.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake index a021e298..a4135677 100644 --- a/cmake/Modules/FindPCAP.cmake +++ b/cmake/Modules/FindPCAP.cmake @@ -102,6 +102,22 @@ else(PCAP_CONFIG) find_path(PCAP_INCLUDE_DIR pcap.h) # Try to find the library + if(WIN32) + # The 64-bit Packet.lib is located under /x64 + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + # + # For the WinPcap and Npcap SDKs, the Lib subdirectory of the top-level + # directory contains 32-bit libraries; the 64-bit libraries are in the + # Lib/x64 directory. + # + # The only way to *FORCE* CMake to look in the Lib/x64 directory + # without searching in the Lib directory first appears to be to set + # CMAKE_LIBRARY_ARCHITECTURE to "x64". + # + set(CMAKE_LIBRARY_ARCHITECTURE "x64") + endif() + endif() + find_library(PCAP_LIBRARY pcap) if(WIN32) if(NOT PCAP_LIBRARY) |