-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0ec8b712e1c06398c81ff76879d6eb5294051bc8
- Loading branch information
Showing
4 changed files
with
44 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
option(USERVER_DOWNLOAD_PACKAGE_BROTLI "Download and setup Brotli if no Brotli of matching version was found" ${USERVER_DOWNLOAD_PACKAGES}) | ||
|
||
set(USERVER_BROTLI_VERSION 1.1.0) | ||
|
||
if (NOT USERVER_FORCE_DOWNLOAD_PACKAGES) | ||
if (USERVER_DOWNLOAD_PACKAGE_BROTLI) | ||
find_package(Brotli ${USERVER_BROTLI_VERSION} QUIET) | ||
else() | ||
find_package(Brotli ${USERVER_BROTLI_VERSION} REQUIRED) | ||
endif() | ||
|
||
if (Brotli_FOUND) | ||
if(NOT TARGET Brotli::dec) | ||
add_library(Brotli::dec ALIAS brotlidec) | ||
endif() | ||
if(NOT TARGET Brotli::enc) | ||
add_library(Brotli::enc ALIAS brotlienc) | ||
endif() | ||
return() | ||
endif() | ||
endif() | ||
|
||
include(DownloadUsingCPM) | ||
CPMAddPackage( | ||
NAME Brotli | ||
VERSION ${USERVER_BROTLI_VERSION} | ||
GITHUB_REPOSITORY google/brotli | ||
) | ||
|
||
set(Brotli_FOUND TRUE) | ||
set(Brotli_VERSION ${USERVER_BROTLI_VERSION}) | ||
add_custom_target(Brotli) | ||
write_package_stub(Brotli) | ||
|
||
if(NOT TARGET Brotli::dec) | ||
add_library(Brotli::dec ALIAS brotlidec) | ||
endif() | ||
if(NOT TARGET Brotli::enc) | ||
add_library(Brotli::enc ALIAS brotlienc) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters