* add usage

* revert

* export targets
This commit is contained in:
Mengna Li 2022-12-20 07:00:59 +08:00 коммит произвёл GitHub
Родитель 2d9fa7a50a
Коммит cc288af760
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 69 добавлений и 3 удалений

Просмотреть файл

@ -0,0 +1,39 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 709390a..3fd83aa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -127,9 +127,9 @@ endif()
# Adds our cmake folder to the search path for find_package
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if(HTTPLIB_REQUIRE_BROTLI)
- find_package(Brotli COMPONENTS encoder decoder common REQUIRED)
+ find_package(unofficial-brotli CONFIG REQUIRED)
elseif(HTTPLIB_USE_BROTLI_IF_AVAILABLE)
- find_package(Brotli COMPONENTS encoder decoder common QUIET)
+ find_package(unofficial-brotli CONFIG QUIET)
endif()
# Just setting this variable here for people building in-tree
if(Brotli_FOUND)
@@ -206,9 +206,9 @@ target_link_libraries(${PROJECT_NAME} ${_INTERFACE_OR_PUBLIC}
$<$<PLATFORM_ID:Windows>:crypt32>
$<$<PLATFORM_ID:Windows>:cryptui>
# Can't put multiple targets in a single generator expression or it bugs out.
- $<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:Brotli::common>
- $<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:Brotli::encoder>
- $<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:Brotli::decoder>
+ $<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:unofficial::brotli::brotlicommon>
+ $<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:unofficial::brotli::brotlienc>
+ $<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:unofficial::brotli::brotlidec>
$<$<BOOL:${HTTPLIB_IS_USING_ZLIB}>:ZLIB::ZLIB>
$<$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>:OpenSSL::SSL>
$<$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>:OpenSSL::Crypto>
@@ -265,9 +265,6 @@ install(FILES "${_httplib_build_includedir}/httplib.h" TYPE INCLUDE)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
- # Install it so it can be used later by the httplibConfig.cmake file.
- # Put it in the same dir as our config file instead of a global path so we don't potentially stomp on other packages.
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindBrotli.cmake"
DESTINATION ${_TARGET_INSTALL_CMAKEDIR}
)

Просмотреть файл

@ -5,9 +5,19 @@ vcpkg_from_github(
REF v0.11.3
SHA512 b0c46bf11c8bc84ab52143559ff1c4682b02504921855e5cd7e82bc65a04b192281ef7a124c7c7dfe928ae3842d5065097b6a4608be1c74dc51b563b15b93d0f
HEAD_REF master
PATCHES
fix-find-brotli.patch
)
file(COPY "${SOURCE_PATH}/httplib.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME httplib CONFIG_PATH lib/cmake/httplib)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib" "${CURRENT_PACKAGES_DIR}/lib")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

Просмотреть файл

@ -1,7 +1,19 @@
{
"name": "cpp-httplib",
"version": "0.11.3",
"port-version": 1,
"description": "A single file C++11 header-only HTTP/HTTPS server and client library",
"homepage": "https://github.com/yhirose/cpp-httplib",
"license": "MIT"
"license": "MIT",
"dependencies": [
"brotli",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

Просмотреть файл

@ -1618,7 +1618,7 @@
},
"cpp-httplib": {
"baseline": "0.11.3",
"port-version": 0
"port-version": 1
},
"cpp-ipc": {
"baseline": "1.2.0",

Просмотреть файл

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d5bea8aab6eaa201dfd01b054327e3c379ab0864",
"version": "0.11.3",
"port-version": 1
},
{
"git-tree": "dc844acd2ec9e3519c5fc73ee5cefc473e912820",
"version": "0.11.3",