At least according to the CMake 2.6 documentation,
authorGuy Harris <guy@alum.mit.edu>
Mon, 24 May 2010 22:50:30 +0000 (22:50 -0000)
committerGuy Harris <guy@alum.mit.edu>
Mon, 24 May 2010 22:50:30 +0000 (22:50 -0000)
CHECK_VARIABLE_EXISTS() can be used to check for C variables; use that
to check for pcap_version.

svn path=/trunk/; revision=32938

CMakeLists.txt
cmake/modules/FindPCAP.cmake

index 46e438ca13a59d280da55acc5f56a75bee4f870b..fc1c02e22374532a98eee46995f44b607fdbc39f 100644 (file)
@@ -337,10 +337,6 @@ endif()
 if(ENABLE_AIRPCAP)
        set(HAVE_AIRPCAP 1)
 endif()
-# Assume that if HAVE_PCAP_LIB_VERSION exists, then HAVE_PCAP_VERSION exists as well
-if(HAVE_PCAP_LIB_VERSION)
-       set(HAVE_PCAP_VERSION 1)
-endif()
 # That's the name autofoo uses
 if(HAVE_LIBZLIB)
        set(HAVE_LIBZ 1)
index 4a59f0551121c4af337cec2e7b74efd55f3f0701..0f5a19a439780988db96f3de3e0da7d91392d55b 100644 (file)
@@ -100,6 +100,7 @@ ENDIF(PCAP_LIBRARIES)
 INCLUDE(CheckFunctionExists)
 SET(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS})
 SET(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES})
+CHECK_VARIABLE_EXISTS("pcap_version" HAVE_PCAP_VERSION)
 CHECK_FUNCTION_EXISTS("pcap_open_dead" HAVE_PCAP_OPEN_DEAD)
 CHECK_FUNCTION_EXISTS("pcap_freecode" HAVE_PCAP_FREECODE)
 #