vcpkg/ports/nghttp3/portfile.cmake
Alexis La Goutte 89d6dc6009
[nghttp3 | ngtcp2] Update nghttp3 ngtcp2 (#30463)
* nghttp3: Update to 0.10.0

* ngtcp2: Update to 0.14.0
2023-03-28 13:39:48 -07:00

46 lines
1.4 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ngtcp2/nghttp3
REF v${VERSION}
SHA512 44dd4f4bb807a4d9f2c85399e83e3146ca8e18b4d4e9bca0b1a9a626daf1f9ca2892bfa55552267a3f43af7e6c6090ec662782936a45bada6faca822d1a31638
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)