From b0f5a220c41af013da3362e5c9751b593b22754a Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Mon, 29 Apr 2019 21:08:02 +0200 Subject: [PATCH] Import FindBrotliDec.cmake and FindBrotliEnc.cmake from Igalia S.L. MIT License, which fits well. Signed-off-by: Andreas Sturmlechner --- cmake/FindBrotliDec.cmake | 35 +++++++++++++++++++++++++++++++++++ cmake/FindBrotliEnc.cmake | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 cmake/FindBrotliDec.cmake create mode 100644 cmake/FindBrotliEnc.cmake diff --git a/cmake/FindBrotliDec.cmake b/cmake/FindBrotliDec.cmake new file mode 100644 index 000000000..abb06f44f --- /dev/null +++ b/cmake/FindBrotliDec.cmake @@ -0,0 +1,35 @@ +# Copyright 2017 Igalia S.L. All Rights Reserved. +# +# Distributed under MIT license. +# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT + +# Try to find BrotliDec. Once done, this will define +# +# BROTLIDEC_FOUND - system has BrotliDec. +# BROTLIDEC_INCLUDE_DIRS - the BrotliDec include directories +# BROTLIDEC_LIBRARIES - link these to use BrotliDec. + +find_package(PkgConfig) + +pkg_check_modules(PC_BROTLIDEC libbrotlidec) + +find_path(BROTLIDEC_INCLUDE_DIRS + NAMES brotli/decode.h + HINTS ${PC_BROTLIDEC_INCLUDEDIR} +) + +find_library(BROTLIDEC_LIBRARIES + NAMES brotlidec + HINTS ${PC_BROTLIDEC_LIBDIR} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(BrotliDec + REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES + FOUND_VAR BROTLIDEC_FOUND + VERSION_VAR PC_BROTLIDEC_VERSION) + +mark_as_advanced( + BROTLIDEC_INCLUDE_DIRS + BROTLIDEC_LIBRARIES +) diff --git a/cmake/FindBrotliEnc.cmake b/cmake/FindBrotliEnc.cmake new file mode 100644 index 000000000..4be347dba --- /dev/null +++ b/cmake/FindBrotliEnc.cmake @@ -0,0 +1,35 @@ +# Copyright 2017 Igalia S.L. All Rights Reserved. +# +# Distributed under MIT license. +# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT + +# Try to find BrotliEnc. Once done, this will define +# +# BROTLIENC_FOUND - system has BrotliEnc. +# BROTLIENC_INCLUDE_DIRS - the BrotliEnc include directories +# BROTLIENC_LIBRARIES - link these to use BrotliEnc. + +find_package(PkgConfig) + +pkg_check_modules(PC_BROTLIENC libbrotlienc) + +find_path(BROTLIENC_INCLUDE_DIRS + NAMES brotli/encode.h + HINTS ${PC_BROTLIENC_INCLUDEDIR} +) + +find_library(BROTLIENC_LIBRARIES + NAMES brotlienc + HINTS ${PC_BROTLIENC_LIBDIR} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(BrotliEnc + REQUIRED_VARS BROTLIENC_INCLUDE_DIRS BROTLIENC_LIBRARIES + FOUND_VAR BROTLIENC_FOUND + VERSION_VAR PC_BROTLIENC_VERSION) + +mark_as_advanced( + BROTLIENC_INCLUDE_DIRS + BROTLIENC_LIBRARIES +)