summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-06-03 04:57:00 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-24 17:25:05 +0200
commitcf9d5f7602745543c616e584a06e46a01112c700 (patch)
tree745e99e790c7b88d8b7ed65c865ae9dd509c2f92
parentaacfd03dba68333da726bb63e2594f3ed4a16422 (diff)
downloadlibgit2-cf9d5f7602745543c616e584a06e46a01112c700.tar.gz
curl: find and link with the library if it's available by default
-rw-r--r--CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cecccb331..012814e7a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,7 @@ OPTION( USE_ICONV "Link with and use iconv library" OFF )
OPTION( USE_SSH "Link with libssh to enable SSH support" ON )
OPTION( USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF )
OPTION( VALGRIND "Configure build for valgrind" OFF )
+OPTION( CURL "User curl for HTTP if available" ON)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET( USE_ICONV ON )
@@ -199,10 +200,20 @@ IF (WIN32 AND WINHTTP)
LINK_LIBRARIES(winhttp rpcrt4 crypt32)
ELSE ()
+ IF (CURL)
+ FIND_PACKAGE(CURL)
+ ENDIF ()
+
IF (NOT AMIGA AND USE_OPENSSL)
FIND_PACKAGE(OpenSSL)
ENDIF ()
+ IF (CURL_FOUND)
+ ADD_DEFINITIONS(-DGIT_CURL)
+ INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
+ LINK_LIBRARIES(${CURL_LIBRARIES})
+ ENDIF()
+
FIND_PACKAGE(HTTP_Parser)
IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
INCLUDE_DIRECTORIES(${HTTP_PARSER_INCLUDE_DIRS})