• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# FindBrotliDec.cmake
2#
3# Copyright (C) 2019-2020 by
4# David Turner, Robert Wilhelm, and Werner Lemberg.
5#
6# Written by Werner Lemberg <wl@gnu.org>
7#
8# This file is part of the FreeType project, and may only be used, modified,
9# and distributed under the terms of the FreeType project license,
10# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
11# indicate that you have read the license and understand and accept it
12# fully.
13#
14#
15# Try to find libbrotlidec include and library directories.
16#
17# If found, the following variables are set.
18#
19#   BROTLIDEC_INCLUDE_DIRS
20#   BROTLIDEC_LIBRARIES
21
22include(FindPkgConfig)
23pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec)
24
25if (PC_BROTLIDEC_VERSION)
26  set(BROTLIDEC_VERSION "${PC_BROTLIDEC_VERSION}")
27endif ()
28
29
30find_path(BROTLIDEC_INCLUDE_DIRS
31  NAMES brotli/decode.h
32  HINTS ${PC_BROTLIDEC_INCLUDEDIR}
33        ${PC_BROTLIDEC_INCLUDE_DIRS}
34  PATH_SUFFIXES brotli)
35
36find_library(BROTLIDEC_LIBRARIES
37  NAMES brotlidec
38  HINTS ${PC_BROTLIDEC_LIBDIR}
39        ${PC_BROTLIDEC_LIBRARY_DIRS})
40
41
42include(FindPackageHandleStandardArgs)
43find_package_handle_standard_args(
44  brotlidec
45  REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES
46  FOUND_VAR BROTLIDEC_FOUND
47  VERSION_VAR BROTLIDEC_VERSION)
48
49mark_as_advanced(
50  BROTLIDEC_INCLUDE_DIRS
51  BROTLIDEC_LIBRARIES)
52