decrypt drsuapi attributes
[wireshark-sm.git] / cmake / modules / FindBROTLI.cmake
blob4ab8dbb41c8c61bcf5745bbcf5d106b418d5dd5e
2 # - Find brotli
3 # Find brotli includes and libraries
5 #  BROTLI_INCLUDE_DIRS - where to find brotli header files
6 #  BROTLI_LIBRARIES    - List of libraries when using brotli.
7 #  BROTLI_FOUND        - True if brotli found.
8 #  BROTLI_DLL_DIR      - (Windows) Path to the brotli DLLs
9 #  BROTLI_DLLS         - (Windows) Name of the brotli DLLs
11 include( FindWSWinLibs )
12 FindWSWinLibs( "brotli-.*" "BROTLI_HINTS" )
14 find_path(BROTLI_INCLUDE_DIR
15   NAMES "brotli/decode.h"
16   HINTS "${BROTLI_HINTS}/include"
19 find_library(BROTLIDEC_LIBRARY
20   NAMES brotlidec
21   HINTS "${BROTLI_HINTS}/lib"
24 include(FindPackageHandleStandardArgs)
25 find_package_handle_standard_args( BROTLI DEFAULT_MSG BROTLIDEC_LIBRARY BROTLI_INCLUDE_DIR )
27 if( BROTLI_FOUND )
28   set( BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR} )
29   set( BROTLI_LIBRARIES ${BROTLIDEC_LIBRARY} )
31   if (WIN32)
32     set ( BROTLI_DLL_DIR "${BROTLI_HINTS}/bin"
33       CACHE PATH "Path to the brotli DLLs"
34     )
35     file( GLOB _brotli_dlls RELATIVE "${BROTLI_DLL_DIR}"
36       "${BROTLI_DLL_DIR}/brotlicommon*.dll"
37       "${BROTLI_DLL_DIR}/brotlidec*.dll"
38     )
39     set ( BROTLI_DLLS ${_brotli_dlls}
40       # We're storing filenames only. Should we use STRING instead?
41       CACHE FILEPATH "brotli DLL list"
42     )
43     mark_as_advanced( BROTLI_DLL_DIR BROTLI_DLLS )
44   endif()
45 else()
46   set( BROTLI_INCLUDE_DIRS )
47   set( BROTLI_LIBRARIES )
48 endif()
50 mark_as_advanced( BROTLI_LIBRARIES BROTLI_INCLUDE_DIRS )