• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# - Find c-ares
2# Find the c-ares includes and library
3# This module defines
4#  CARES_INCLUDE_DIR, where to find ares.h, etc.
5#  CARES_LIBRARIES, the libraries needed to use c-ares.
6#  CARES_FOUND, If false, do not try to use c-ares.
7# also defined, but not for general use are
8# CARES_LIBRARY, where to find the c-ares library.
9
10FIND_PATH(CARES_INCLUDE_DIR ares.h
11  /usr/local/include
12  /usr/include
13  )
14
15SET(CARES_NAMES ${CARES_NAMES} cares)
16FIND_LIBRARY(CARES_LIBRARY
17  NAMES ${CARES_NAMES}
18  PATHS /usr/lib /usr/local/lib
19  )
20
21IF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
22  SET(CARES_LIBRARIES ${CARES_LIBRARY})
23  SET(CARES_FOUND "YES")
24ELSE (CARES_LIBRARY AND CARES_INCLUDE_DIR)
25  SET(CARES_FOUND "NO")
26ENDIF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
27
28
29IF (CARES_FOUND)
30  IF (NOT CARES_FIND_QUIETLY)
31    MESSAGE(STATUS "Found c-ares: ${CARES_LIBRARIES}")
32  ENDIF (NOT CARES_FIND_QUIETLY)
33ELSE (CARES_FOUND)
34  IF (CARES_FIND_REQUIRED)
35    MESSAGE(FATAL_ERROR "Could not find c-ares library")
36  ENDIF (CARES_FIND_REQUIRED)
37ENDIF (CARES_FOUND)
38
39MARK_AS_ADVANCED(
40  CARES_LIBRARY
41  CARES_INCLUDE_DIR
42  )
43