From d22e5e02a2d3670a79cf09bed81613ca90738163 Mon Sep 17 00:00:00 2001 From: Don Date: Fri, 16 Mar 2018 12:49:13 -0700 Subject: 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 --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'CMakeLists.txt') 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) -- cgit v1.2.3