vcpkg/ports/nghttp2/portfile.cmake

47 lines
1.3 KiB
CMake
Raw Normal View History

set(LIB_NAME nghttp2)
2020-12-05 07:59:14 +08:00
set(LIB_VERSION 1.42.0)
set(LIB_FILENAME ${LIB_NAME}-${LIB_VERSION}.tar.gz)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO nghttp2/nghttp2
REF v${LIB_VERSION}
2020-12-05 07:59:14 +08:00
SHA512 717494c9aa4eda64414535752df947d62311e7aed5cc6c4936400fcb2c9fc2818923668bcabc3e1bc61154d660f6765dad120e5a113d9eee3e934d66ee63a406
HEAD_REF master
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(ENABLE_STATIC_LIB ON)
set(ENABLE_SHARED_LIB OFF)
else()
set(ENABLE_STATIC_LIB OFF)
set(ENABLE_SHARED_LIB ON)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
2018-02-08 04:12:14 +08:00
PREFER_NINJA
OPTIONS
-DENABLE_LIB_ONLY=ON
-DENABLE_ASIO_LIB=OFF
-DENABLE_STATIC_LIB=${ENABLE_STATIC_LIB}
-DENABLE_SHARED_LIB=${ENABLE_SHARED_LIB}
)
vcpkg_install_cmake()
2020-12-05 07:59:14 +08:00
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/man)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc)
2019-08-15 15:40:16 +08:00
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_copy_pdbs()