• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# - Try to find libbrotlidec
2# Once done this will define
3#  LIBBROTLIDEC_FOUND        - System has libbrotlidec
4#  LIBBROTLIDEC_INCLUDE_DIRS - The libbrotlidec include directories
5#  LIBBROTLIDEC_LIBRARIES    - The libraries needed to use libbrotlidec
6
7find_package(PkgConfig QUIET)
8pkg_check_modules(PC_LIBBROTLIDEC QUIET libbrotlidec)
9
10find_path(LIBBROTLIDEC_INCLUDE_DIR
11  NAMES brotli/decode.h
12  HINTS ${PC_LIBBROTLIDEC_INCLUDE_DIRS}
13)
14find_library(LIBBROTLIDEC_LIBRARY
15  NAMES brotlidec
16  HINTS ${PC_LIBBROTLIDEC_LIBRARY_DIRS}
17)
18
19if(PC_LIBBROTLIDEC_FOUND)
20  set(LIBBROTLIDEC_VERSION ${PC_LIBBROTLIDEC_VERSION})
21endif()
22
23include(FindPackageHandleStandardArgs)
24# handle the QUIETLY and REQUIRED arguments and set LIBBROTLIDEC_FOUND
25# to TRUE if all listed variables are TRUE and the requested version
26# matches.
27find_package_handle_standard_args(Libbrotlidec REQUIRED_VARS
28                                  LIBBROTLIDEC_LIBRARY LIBBROTLIDEC_INCLUDE_DIR
29                                  VERSION_VAR LIBBROTLIDEC_VERSION)
30
31if(LIBBROTLIDEC_FOUND)
32  set(LIBBROTLIDEC_LIBRARIES     ${LIBBROTLIDEC_LIBRARY})
33  set(LIBBROTLIDEC_INCLUDE_DIRS  ${LIBBROTLIDEC_INCLUDE_DIR})
34endif()
35
36mark_as_advanced(LIBBROTLIDEC_INCLUDE_DIR LIBBROTLIDEC_LIBRARY)
37