tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

FindBrotliDec.cmake (1333B)


      1 # FindBrotliDec.cmake
      2 #
      3 # Copyright (C) 2019-2025 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 
     22 find_package(PkgConfig QUIET)
     23 
     24 pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec)
     25 
     26 if (PC_BROTLIDEC_VERSION)
     27  set(BROTLIDEC_VERSION "${PC_BROTLIDEC_VERSION}")
     28 endif ()
     29 
     30 
     31 find_path(BROTLIDEC_INCLUDE_DIRS
     32  NAMES brotli/decode.h
     33  HINTS ${PC_BROTLIDEC_INCLUDEDIR}
     34        ${PC_BROTLIDEC_INCLUDE_DIRS}
     35  PATH_SUFFIXES brotli)
     36 
     37 find_library(BROTLIDEC_LIBRARIES
     38  NAMES brotlidec
     39  HINTS ${PC_BROTLIDEC_LIBDIR}
     40        ${PC_BROTLIDEC_LIBRARY_DIRS})
     41 
     42 
     43 include(FindPackageHandleStandardArgs)
     44 find_package_handle_standard_args(
     45  BrotliDec
     46  REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES
     47  FOUND_VAR BROTLIDEC_FOUND
     48  VERSION_VAR BROTLIDEC_VERSION)
     49 
     50 mark_as_advanced(
     51  BROTLIDEC_INCLUDE_DIRS
     52  BROTLIDEC_LIBRARIES)