]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Try to find the 64-bit libraries in a 64-bit build.
authorGuy Harris <[email protected]>
Thu, 13 Sep 2018 23:26:39 +0000 (16:26 -0700)
committerGuy Harris <[email protected]>
Thu, 13 Sep 2018 23:26:39 +0000 (16:26 -0700)
cmake/Modules/FindPCAP.cmake

index a021e29811a9bbca1ab9aca79b98236954722ee0..a41356778c090fab59ffcaa3723ea5d7a0562c52 100644 (file)
@@ -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)