2017-12-21 16:13:50 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
|
|
|
set(LIB_NAME nghttp2)
|
2018-02-08 04:17:25 +08:00
|
|
|
set(LIB_VERSION 1.30.0)
|
2017-12-21 16:13:50 +08:00
|
|
|
|
|
|
|
set(LIB_FILENAME ${LIB_NAME}-${LIB_VERSION}.tar.gz)
|
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/${LIB_NAME}-${LIB_VERSION})
|
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
|
|
|
URLS "https://github.com/nghttp2/nghttp2/releases/download/v${LIB_VERSION}/${LIB_FILENAME}"
|
|
|
|
FILENAME "${LIB_FILENAME}"
|
2018-02-08 04:17:25 +08:00
|
|
|
SHA512 26ce717a085e9fbdf8e644d4c8ab6961ca60029c4dfa112c9932523d1c4cc3f40fda4283afddf78a649e7f6fb7d3f3bfce3197186a4f70819b5996e8158089da
|
2017-12-21 16:13:50 +08:00
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE})
|
|
|
|
|
2018-02-08 04:12:14 +08:00
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/enable-static.patch"
|
|
|
|
)
|
|
|
|
|
2017-12-21 16:13:50 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2018-02-08 04:12:14 +08:00
|
|
|
PREFER_NINJA
|
2017-12-21 16:13:50 +08:00
|
|
|
OPTIONS
|
|
|
|
-DENABLE_LIB_ONLY=ON
|
|
|
|
-DENABLE_ASIO_LIB=OFF
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
# Remove unwanted files
|
|
|
|
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)
|
|
|
|
|
|
|
|
# Move dll files from /lib to /bin where vcpkg expects them
|
2018-02-08 04:12:14 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2017-12-21 16:13:50 +08:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/${LIB_NAME}.dll ${CURRENT_PACKAGES_DIR}/bin/${LIB_NAME}.dll)
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/${LIB_NAME}.dll ${CURRENT_PACKAGES_DIR}/debug/bin/${LIB_NAME}.dll)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# License and man
|
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${LIB_NAME} RENAME copyright)
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|