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
21 HINTS "${BROTLI_HINTS}/lib"
24 include(FindPackageHandleStandardArgs)
25 find_package_handle_standard_args( BROTLI DEFAULT_MSG BROTLIDEC_LIBRARY BROTLI_INCLUDE_DIR )
28 set( BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR} )
29 set( BROTLI_LIBRARIES ${BROTLIDEC_LIBRARY} )
32 set ( BROTLI_DLL_DIR "${BROTLI_HINTS}/bin"
33 CACHE PATH "Path to the brotli DLLs"
35 file( GLOB _brotli_dlls RELATIVE "${BROTLI_DLL_DIR}"
36 "${BROTLI_DLL_DIR}/brotlicommon*.dll"
37 "${BROTLI_DLL_DIR}/brotlidec*.dll"
39 set ( BROTLI_DLLS ${_brotli_dlls}
40 # We're storing filenames only. Should we use STRING instead?
41 CACHE FILEPATH "brotli DLL list"
43 mark_as_advanced( BROTLI_DLL_DIR BROTLI_DLLS )
46 set( BROTLI_INCLUDE_DIRS )
47 set( BROTLI_LIBRARIES )
50 mark_as_advanced( BROTLI_LIBRARIES BROTLI_INCLUDE_DIRS )