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() 25 set(CARES_FOUND "NO") 26endif() 27 28 29if(CARES_FOUND) 30 if(NOT CARES_FIND_QUIETLY) 31 message(STATUS "Found c-ares: ${CARES_LIBRARIES}") 32 endif() 33else() 34 if(CARES_FIND_REQUIRED) 35 message(FATAL_ERROR "Could not find c-ares library") 36 endif() 37endif() 38 39mark_as_advanced( 40 CARES_LIBRARY 41 CARES_INCLUDE_DIR 42 ) 43