summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDon <don.j.olmstead@gmail.com>2018-03-16 12:49:13 -0700
committerDaniel Stenberg <daniel@haxx.se>2018-03-19 08:28:32 +0100
commitd22e5e02a2d3670a79cf09bed81613ca90738163 (patch)
tree17d5fbeaaf63b16be4f483d2beda2dd440b4bef0 /CMakeLists.txt
parentb7b2809a212a69f1ce59a25ba86b4f1d8a17ebc4 (diff)
downloadcurl-d22e5e02a2d3670a79cf09bed81613ca90738163.tar.gz
cmake: add support for brotli
Currently CMake cannot detect Brotli support. This adds detection of the libraries and associated header files. It also adds this to the generated config. Closes #2392
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 490cc19ef..3232e9a49 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -521,6 +521,18 @@ if(CURL_ZLIB)
endif()
endif()
+option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF)
+set(HAVE_BROTLI OFF)
+if(CURL_BROTLI)
+ find_package(BROTLI QUIET)
+ if(BROTLI_FOUND)
+ set(HAVE_BROTLI ON)
+ list(APPEND CURL_LIBS ${BROTLI_LIBRARIES})
+ include_directories(${BROTLI_INCLUDE_DIRS})
+ list(APPEND CMAKE_REQUIRED_INCLUDES ${BROTLI_INCLUDE_DIRS})
+ endif()
+endif()
+
#libSSH2
option(CMAKE_USE_LIBSSH2 "Use libSSH2" ON)
mark_as_advanced(CMAKE_USE_LIBSSH2)