diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-07-14 19:03:31 +0000 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-07-14 19:03:31 +0000 |
commit | a8ea1e9ef4ec959cfe95193318a05688f4610841 (patch) | |
tree | c336fdf5cb277cad0bb61adda2e42ac61da551a9 /CMake | |
parent | 6dade671adac2a02f1a5d68046e844967a4e639b (diff) | |
download | curl-a8ea1e9ef4ec959cfe95193318a05688f4610841.tar.gz |
ENH: add optional support for c-ares
Diffstat (limited to 'CMake')
-rwxr-xr-x | CMake/FindCARES.cmake | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/CMake/FindCARES.cmake b/CMake/FindCARES.cmake new file mode 100755 index 000000000..7e92a8e7c --- /dev/null +++ b/CMake/FindCARES.cmake @@ -0,0 +1,42 @@ +# - Find c-ares +# Find the c-ares includes and library +# This module defines +# CARES_INCLUDE_DIR, where to find ares.h, etc. +# CARES_LIBRARIES, the libraries needed to use c-ares. +# CARES_FOUND, If false, do not try to use c-ares. +# also defined, but not for general use are +# CARES_LIBRARY, where to find the c-ares library. + +FIND_PATH(CARES_INCLUDE_DIR ares.h + /usr/local/include + /usr/include + ) + +SET(CARES_NAMES ${CARES_NAMES} cares) +FIND_LIBRARY(CARES_LIBRARY + NAMES ${CARES_NAMES} + PATHS /usr/lib /usr/local/lib + ) + +IF (CARES_LIBRARY AND CARES_INCLUDE_DIR) + SET(CARES_LIBRARIES ${CARES_LIBRARY}) + SET(CARES_FOUND "YES") +ELSE (CARES_LIBRARY AND CARES_INCLUDE_DIR) + SET(CARES_FOUND "NO") +ENDIF (CARES_LIBRARY AND CARES_INCLUDE_DIR) + + +IF (CARES_FOUND) + IF (NOT CARES_FIND_QUIETLY) + MESSAGE(STATUS "Found c-ares: ${CARES_LIBRARIES}") + ENDIF (NOT CARES_FIND_QUIETLY) +ELSE (CARES_FOUND) + IF (CARES_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find c-ares library") + ENDIF (CARES_FIND_REQUIRED) +ENDIF (CARES_FOUND) + +MARK_AS_ADVANCED( + CARES_LIBRARY + CARES_INCLUDE_DIR + ) |