File: FindGEOIP.cmake

package info (click to toggle)
wireshark 1.8.2-5wheezy18
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 196,124 kB
  • sloc: ansic: 2,186,574; xml: 55,064; python: 30,233; perl: 22,353; sh: 13,118; pascal: 5,964; lex: 4,963; cpp: 3,604; makefile: 3,471; yacc: 266; asm: 156; tcl: 35
file content (41 lines) | stat: -rw-r--r-- 1,269 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# $Id: FindGEOIP.cmake 39307 2011-10-08 06:09:38Z jmayer $
#
# - Find GeoIP
# Find the native GEOIP includes and library
#
#  GEOIP_INCLUDE_DIRS - where to find GeoIP.h, etc.
#  GEOIP_LIBRARIES    - List of libraries when using GeoIP.
#  GEOIP_FOUND        - True if GeoIP found.


IF (GEOIP_INCLUDE_DIRS)
  # Already in cache, be silent
  SET(GEOIP_FIND_QUIETLY TRUE)
ENDIF (GEOIP_INCLUDE_DIRS)

FIND_PATH(GEOIP_INCLUDE_DIR GeoIP.h)

SET(GEOIP_NAMES GeoIP)
FIND_LIBRARY(GEOIP_LIBRARY NAMES ${GEOIP_NAMES} )

# handle the QUIETLY and REQUIRED arguments and set GEOIP_FOUND to TRUE if 
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOIP DEFAULT_MSG GEOIP_LIBRARY GEOIP_INCLUDE_DIR)

IF(GEOIP_FOUND)
  SET(GEOIP_LIBRARIES ${GEOIP_LIBRARY} )
  SET(GEOIP_INCLUDE_DIRS ${GEOIP_INCLUDE_DIR} )
  INCLUDE(CheckFunctionExists)
  SET(CMAKE_REQUIRED_INCLUDES ${GEOIP_INCLUDE_DIRS})
  SET(CMAKE_REQUIRED_LIBRARIES ${GEOIP_LIBRARIES})
  CHECK_FUNCTION_EXISTS("GeoIP_country_name_by_ipnum_v6" HAVE_GEOIP_V6)
  SET(CMAKE_REQUIRED_INCLUDES "")
  SET(CMAKE_REQUIRED_LIBRARIES "")
ELSE(GEOIP_FOUND)
  SET(GEOIP_LIBRARIES )
  SET(GEOIP_INCLUDE_DIRS )
ENDIF(GEOIP_FOUND)

MARK_AS_ADVANCED( GEOIP_LIBRARIES GEOIP_INCLUDE_DIRS )