vcpkg/ports/nghttp3/portfile.cmake
Alexis La Goutte 5682b9c3d9
[nghttp3] update to 0.7.1 (#26989)
* nghttp3: update to 0.7.1

* nghttp3: remove port-version

Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com>

* update version

* remove wrong git-tree

Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com>
Co-authored-by: Jonliu1993 <13720414433@163.com>
2022-09-28 11:27:52 -07:00

46 lines
1.4 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ngtcp2/nghttp3
REF v0.7.1
SHA512 88b095b631235d7b0f568757c09f186a5cafe395f2eef4afb78bbe7185824113c40872379d75e7d63c9f637a26da61217465091875f788eef719fce31a7a83a6
HEAD_REF main
)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" ENABLE_STATIC_CRT)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC_LIB)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED_LIB)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DENABLE_LIB_ONLY=ON
-DBUILD_TESTING=OFF
"-DENABLE_STATIC_CRT=${ENABLE_STATIC_CRT}"
"-DENABLE_STATIC_LIB=${ENABLE_STATIC_LIB}"
"-DENABLE_SHARED_LIB=${ENABLE_SHARED_LIB}"
-DCMAKE_DISABLE_FIND_PACKAGE_CUnit=ON
MAYBE_UNUSED_VARIABLES
BUILD_TESTING
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/share/man"
"${CURRENT_PACKAGES_DIR}/share/doc"
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/bin"
"${CURRENT_PACKAGES_DIR}/debug/bin"
)
file(APPEND "${CURRENT_PACKAGES_DIR}/include/nghttp3/version.h" [[
]])
endif()
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)