Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions cmake/FindBrotliDec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,26 @@ find_package(PkgConfig)

pkg_check_modules(PC_BROTLIDEC libbrotlidec)

if(NOT PC_BROTLIDEC_LIBRARIES)
# Fall-back for systems without pkg-config; both libraries must
# be present, otherwise linking will likely fail for static builds.
list(APPEND PC_BROTLIDEC_LIBRARIES brotlidec brotlicommon)
endif()

find_path(BROTLIDEC_INCLUDE_DIRS
NAMES brotli/decode.h
HINTS ${PC_BROTLIDEC_INCLUDEDIR}
)

find_library(BROTLIDEC_LIBRARIES
NAMES brotlidec
HINTS ${PC_BROTLIDEC_LIBDIR}
)
set(BROTLIDEC_LIBRARIES "")
foreach(_lib ${PC_BROTLIDEC_LIBRARIES})
find_library(BROTLIDEC_PATH_${_lib} ${_lib} HINTS ${PC_BROTLIDEC_LIBRARY_DIRS})
if(NOT BROTLIDEC_PATH_${_lib})
unset(BROTLIDEC_LIBRARIES)
break()
endif()
list(APPEND BROTLIDEC_LIBRARIES "${BROTLIDEC_PATH_${_lib}}")
endforeach()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(BrotliDec
Expand Down
20 changes: 16 additions & 4 deletions cmake/FindBrotliEnc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,27 @@ find_package(PkgConfig)

pkg_check_modules(PC_BROTLIENC libbrotlienc)

if(NOT PC_BROTLIENC_LIBRARIES)
# Fall-back for systems without pkg-config; both libraries must
# be present, otherwise linking will likely fail for static builds.
list(APPEND PC_BROTLIENC_LIBRARIES brotlienc brotlicommon)
endif()

find_path(BROTLIENC_INCLUDE_DIRS
NAMES brotli/encode.h
HINTS ${PC_BROTLIENC_INCLUDEDIR}
)

find_library(BROTLIENC_LIBRARIES
NAMES brotlienc
HINTS ${PC_BROTLIENC_LIBDIR}
)
set(BROTLIENC_LIBRARIES "")
foreach(_lib ${PC_BROTLIENC_LIBRARIES})
find_library(BROTLIENC_PATH_${_lib} ${_lib}
HINTS ${PC_BROTLIENC_LIBRARY_DIRS})
if(NOT BROTLIENC_PATH_${_lib})
unset(BROTLIENC_LIBRARIES)
break()
endif()
list(APPEND BROTLIENC_LIBRARIES "${BROTLIENC_PATH_${_lib}}")
endforeach()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(BrotliEnc
Expand Down