1# - Try to find libbrotlienc 2# Once done this will define 3# LIBBROTLIENC_FOUND - System has libbrotlienc 4# LIBBROTLIENC_INCLUDE_DIRS - The libbrotlienc include directories 5# LIBBROTLIENC_LIBRARIES - The libraries needed to use libbrotlienc 6 7find_package(PkgConfig QUIET) 8pkg_check_modules(PC_LIBBROTLIENC QUIET libbrotlienc) 9 10find_path(LIBBROTLIENC_INCLUDE_DIR 11 NAMES brotli/encode.h 12 HINTS ${PC_LIBBROTLIENC_INCLUDE_DIRS} 13) 14find_library(LIBBROTLIENC_LIBRARY 15 NAMES brotlienc 16 HINTS ${PC_LIBBROTLIENC_LIBRARY_DIRS} 17) 18 19if(PC_LIBBROTLIENC_FOUND) 20 set(LIBBROTLIENC_VERSION ${PC_LIBBROTLIENC_VERSION}) 21endif() 22 23include(FindPackageHandleStandardArgs) 24# handle the QUIETLY and REQUIRED arguments and set LIBBROTLIENC_FOUND 25# to TRUE if all listed variables are TRUE and the requested version 26# matches. 27find_package_handle_standard_args(Libbrotlienc REQUIRED_VARS 28 LIBBROTLIENC_LIBRARY LIBBROTLIENC_INCLUDE_DIR 29 VERSION_VAR LIBBROTLIENC_VERSION) 30 31if(LIBBROTLIENC_FOUND) 32 set(LIBBROTLIENC_LIBRARIES ${LIBBROTLIENC_LIBRARY}) 33 set(LIBBROTLIENC_INCLUDE_DIRS ${LIBBROTLIENC_INCLUDE_DIR}) 34endif() 35 36mark_as_advanced(LIBBROTLIENC_INCLUDE_DIR LIBBROTLIENC_LIBRARY) 37