summaryrefslogtreecommitdiffstats
path: root/Modules/FindCURL.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-19 16:55:44 (GMT)
committerBrad King <brad.king@kitware.com>2006-10-19 16:55:44 (GMT)
commitd25595a83cf524765965061c03c724c780abc5bb (patch)
tree9b64b45c90a6fe59cfdec5a573c4d653e37165ec /Modules/FindCURL.cmake
parentf7a5289e318e3802737a2629c7fe2ed24dbfc5b9 (diff)
downloadCMake-d25595a83cf524765965061c03c724c780abc5bb.zip
CMake-d25595a83cf524765965061c03c724c780abc5bb.tar.gz
CMake-d25595a83cf524765965061c03c724c780abc5bb.tar.bz2
ENH: Find module for CURL library.
Diffstat (limited to 'Modules/FindCURL.cmake')
-rw-r--r--Modules/FindCURL.cmake38
1 files changed, 38 insertions, 0 deletions
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
new file mode 100644
index 0000000..57c1bbc
--- /dev/null
+++ b/Modules/FindCURL.cmake
@@ -0,0 +1,38 @@
+# - Find curl
+# Find the native CURL headers and libraries.
+#
+# CURL_INCLUDE_DIRS - where to find curl/curl.h, etc.
+# CURL_LIBRARIES - List of libraries when using curl.
+# CURL_FOUND - True if curl found.
+
+# Look for the header file.
+FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h)
+MARK_AS_ADVANCED(CURL_INCLUDE_DIR)
+
+# Look for the library.
+FIND_LIBRARY(CURL_LIBRARY NAMES curl)
+MARK_AS_ADVANCED(CURL_LIBRARY)
+
+# Copy the results to the output variables.
+IF(CURL_INCLUDE_DIR AND CURL_LIBRARY)
+ SET(CURL_FOUND 1)
+ SET(CURL_LIBRARIES ${CURL_LIBRARY})
+ SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
+ELSE(CURL_INCLUDE_DIR AND CURL_LIBRARY)
+ SET(CURL_FOUND 0)
+ SET(CURL_LIBRARIES)
+ SET(CURL_INCLUDE_DIRS)
+ENDIF(CURL_INCLUDE_DIR AND CURL_LIBRARY)
+
+# Report the results.
+IF(NOT CURL_FOUND)
+ SET(CURL_DIR_MESSAGE
+ "CURL was not found. Make sure CURL_LIBRARY and CURL_INCLUDE_DIR are set.")
+ IF(NOT CURL_FIND_QUIETLY)
+ MESSAGE(STATUS "${CURL_DIR_MESSAGE}")
+ ELSE(NOT CURL_FIND_QUIETLY)
+ IF(CURL_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${CURL_DIR_MESSAGE}")
+ ENDIF(CURL_FIND_REQUIRED)
+ ENDIF(NOT CURL_FIND_QUIETLY)
+ENDIF(NOT CURL_FOUND)