FindCARES.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. FIND_PATH(CARES_INCLUDE_DIR ares.h
  10. /usr/local/include
  11. /usr/include
  12. )
  13. SET(CARES_NAMES ${CARES_NAMES} cares)
  14. FIND_LIBRARY(CARES_LIBRARY
  15. NAMES ${CARES_NAMES}
  16. PATHS /usr/lib /usr/local/lib
  17. )
  18. IF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
  19. SET(CARES_LIBRARIES ${CARES_LIBRARY})
  20. SET(CARES_FOUND "YES")
  21. ELSE (CARES_LIBRARY AND CARES_INCLUDE_DIR)
  22. SET(CARES_FOUND "NO")
  23. ENDIF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
  24. IF (CARES_FOUND)
  25. IF (NOT CARES_FIND_QUIETLY)
  26. MESSAGE(STATUS "Found c-ares: ${CARES_LIBRARIES}")
  27. ENDIF (NOT CARES_FIND_QUIETLY)
  28. ELSE (CARES_FOUND)
  29. IF (CARES_FIND_REQUIRED)
  30. MESSAGE(FATAL_ERROR "Could not find c-ares library")
  31. ENDIF (CARES_FIND_REQUIRED)
  32. ENDIF (CARES_FOUND)
  33. MARK_AS_ADVANCED(
  34. CARES_LIBRARY
  35. CARES_INCLUDE_DIR
  36. )