aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindCARES.cmake
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2009-09-09 13:20:33 +0000
committerJörg Mayer <jmayer@loplof.de>2009-09-09 13:20:33 +0000
commitca6b1e2b2142c7727bca82540c14d2a9c41e1a05 (patch)
tree5f35b5d74741be36415415d8d68acdd479e5c606 /cmake/modules/FindCARES.cmake
parenta65f72e8f045ec9c17848c6508c9ccd27e2e91f4 (diff)
CMAKE: Get most of of missing *build* pieces into place
svn path=/trunk/; revision=29819
Diffstat (limited to 'cmake/modules/FindCARES.cmake')
-rw-r--r--cmake/modules/FindCARES.cmake32
1 files changed, 32 insertions, 0 deletions
diff --git a/cmake/modules/FindCARES.cmake b/cmake/modules/FindCARES.cmake
new file mode 100644
index 0000000000..6c046bec14
--- /dev/null
+++ b/cmake/modules/FindCARES.cmake
@@ -0,0 +1,32 @@
+# - Find cares
+# Find the native CARES includes and library
+#
+# CARES_INCLUDE_DIRS - where to find cares.h, etc.
+# CARES_LIBRARIES - List of libraries when using cares.
+# CARES_FOUND - True if cares found.
+
+
+IF (CARES_INCLUDE_DIRS)
+ # Already in cache, be silent
+ SET(CARES_FIND_QUIETLY TRUE)
+ENDIF (CARES_INCLUDE_DIRS)
+
+FIND_PATH(CARES_INCLUDE_DIR cares.h)
+
+SET(CARES_NAMES cares)
+FIND_LIBRARY(CARES_LIBRARY NAMES ${CARES_NAMES} )
+
+# handle the QUIETLY and REQUIRED arguments and set CARES_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CARES DEFAULT_MSG CARES_LIBRARY CARES_INCLUDE_DIR)
+
+IF(CARES_FOUND)
+ SET( CARES_LIBRARIES ${CARES_LIBRARY} )
+ SET( CARES_INCLUDE_DIRS ${CARES_INCLUDE_DIR} )
+ELSE(CARES_FOUND)
+ SET( CARES_LIBRARIES )
+ SET( CARES_INCLUDE_DIRS )
+ENDIF(CARES_FOUND)
+
+MARK_AS_ADVANCED( CARES_LIBRARIES CARES_INCLUDE_DIRS )