]> The Tcpdump Group git mirrors - libpcap/commitdiff
CMake: change most PACKET to Packet.
authorGuy Harris <[email protected]>
Thu, 3 Mar 2022 02:30:26 +0000 (18:30 -0800)
committerGuy Harris <[email protected]>
Wed, 16 Mar 2022 00:06:57 +0000 (17:06 -0700)
This squelches a warning from CMake.

(cherry picked from commit fa7b098b71eb7d29502c30c3352427d212fc4a39)

CMakeLists.txt
cmake/Modules/FindPacket.cmake

index 7664bd7f19af81e5edaa135f43bda909311481bd..75fc26e580c12e158273af51f50dbecb94baf261 100644 (file)
@@ -306,19 +306,19 @@ if(WIN32)
     endif(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/../../Common)
 
     find_package(Packet)
-    if(PACKET_FOUND)
+    if(Packet_FOUND)
         set(HAVE_PACKET32 TRUE)
-        include_directories(${PACKET_INCLUDE_DIRS})
+        include_directories(${Packet_INCLUDE_DIRS})
         #
         # Check whether we have the NPcap PacketIsLoopbackAdapter()
         # function.
         #
         cmake_push_check_state()
-        set(CMAKE_REQUIRED_LIBRARIES ${PACKET_LIBRARIES})
+        set(CMAKE_REQUIRED_LIBRARIES ${Packet_LIBRARIES})
         check_function_exists(PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER)
         check_function_exists(PacketGetTimestampModes HAVE_PACKET_GET_TIMESTAMP_MODES)
         cmake_pop_check_state()
-    endif(PACKET_FOUND)
+    endif(Packet_FOUND)
 
     message(STATUS "checking for Npcap's version.h")
     check_symbol_exists(WINPCAP_PRODUCT_NAME "${CMAKE_SOURCE_DIR}/../../version.h" HAVE_VERSION_H)
@@ -1253,7 +1253,7 @@ if(WIN32)
         #
         # Link with packet.dll before Winsock2.
         #
-        set(PCAP_LINK_LIBRARIES ${PACKET_LIBRARIES} ${PCAP_LINK_LIBRARIES})
+        set(PCAP_LINK_LIBRARIES ${Packet_LIBRARIES} ${PCAP_LINK_LIBRARIES})
     elseif(PCAP_TYPE STREQUAL "null")
     else()
         message(FATAL_ERROR "${PCAP_TYPE} is not a valid pcap type")
index c008c06b061d57cd15b016e96a1e653c8152c544..8224cd3f3e5c8358b2fa772c400478e579260808 100644 (file)
 #
 # This module defines the following variables:
 #
-# PACKET_INCLUDE_DIR     - absolute path to the directory containing Packet32.h.
+# Packet_INCLUDE_DIR     - absolute path to the directory containing Packet32.h.
 #
-# PACKET_LIBRARY         - relative or absolute path to the Packet library to
+# Packet_LIBRARY         - relative or absolute path to the Packet library to
 #                          link with. An absolute path is will be used if the
 #                          Packet library is not located in the compiler's
 #                          default search path.
 
-# PACKET_FOUND           - TRUE if the Packet library *and* header are found.
+# Packet_FOUND           - TRUE if the Packet library *and* header are found.
 #
 # Hints and Backward Compatibility
 # ================================
@@ -86,24 +86,24 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
 endif()
 
 # Find the header
-find_path(PACKET_INCLUDE_DIR Packet32.h
+find_path(Packet_INCLUDE_DIR Packet32.h
   PATH_SUFFIXES include Include
 )
 
 # Find the library
-find_library(PACKET_LIBRARY
+find_library(Packet_LIBRARY
   NAMES Packet packet
 )
 
-# Set PACKET_FOUND to TRUE if PACKET_INCLUDE_DIR and PACKET_LIBRARY are TRUE.
+# Set Packet_FOUND to TRUE if Packet_INCLUDE_DIR and Packet_LIBRARY are TRUE.
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(PACKET
+find_package_handle_standard_args(Packet
   DEFAULT_MSG
-  PACKET_INCLUDE_DIR
-  PACKET_LIBRARY
+  Packet_INCLUDE_DIR
+  Packet_LIBRARY
 )
 
-mark_as_advanced(PACKET_INCLUDE_DIR PACKET_LIBRARY)
+mark_as_advanced(Packet_INCLUDE_DIR Packet_LIBRARY)
 
-set(PACKET_INCLUDE_DIRS ${PACKET_INCLUDE_DIR})
-set(PACKET_LIBRARIES ${PACKET_LIBRARY})
+set(Packet_INCLUDE_DIRS ${Packet_INCLUDE_DIR})
+set(Packet_LIBRARIES ${Packet_LIBRARY})