aboutsummaryrefslogtreecommitdiff
path: root/CMake
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 /CMake
parentb7b2809a212a69f1ce59a25ba86b4f1d8a17ebc4 (diff)
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 'CMake')
-rw-r--r--CMake/FindBrotli.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/CMake/FindBrotli.cmake b/CMake/FindBrotli.cmake
new file mode 100644
index 000000000..351b8f757
--- /dev/null
+++ b/CMake/FindBrotli.cmake
@@ -0,0 +1,20 @@
+include(FindPackageHandleStandardArgs)
+
+find_path(BROTLI_INCLUDE_DIR "brotli/decode.h")
+
+find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon)
+find_library(BROTLIDEC_LIBRARY NAMES brotlidec)
+
+find_package_handle_standard_args(BROTLI
+ FOUND_VAR
+ BROTLI_FOUND
+ REQUIRED_VARS
+ BROTLIDEC_LIBRARY
+ BROTLICOMMON_LIBRARY
+ BROTLI_INCLUDE_DIR
+ FAIL_MESSAGE
+ "Could NOT find BROTLI"
+)
+
+set(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
+set(BROTLI_LIBRARIES ${BROTLICOMMON_LIBRARY} ${BROTLIDEC_LIBRARY})