[knet] Add new port (#13207)

This commit is contained in:
Kiba Amor 2020-09-04 02:10:29 +08:00 committed by GitHub
parent eae14ae63c
commit dbb91b64d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 0 deletions

30
ports/knet/portfile.cmake Normal file
View File

@ -0,0 +1,30 @@
vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "uwp")
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO kibaamor/knet
REF v1.0.1
SHA512 c9d3d876bef89d2b2c10f4f91ff3dc70a036e2437bf96fd57df8de07275b7b99b214ad332db94d7f1da587b22e6bd00bfde1d7d4b23277639ea0cef1f0a6f59c
HEAD_REF master
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DKNET_BUILD_EXAMPLE:BOOL=OFF
-DKNET_BUILD_TEST:BOOL=OFF
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/knet TARGET_PATH share/knet)
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})

4
ports/knet/usage Normal file
View File

@ -0,0 +1,4 @@
The package knet provides CMake integration:
find_package(knet CONFIG REQUIRED)
target_link_libraries(main PRIVATE knet)

8
ports/knet/vcpkg.json Normal file
View File

@ -0,0 +1,8 @@
{
"name": "knet",
"version-string": "1.0.1",
"description": "A cross platform lock-free and timer-supported C++11 network library.",
"homepage": "https://github.com/kibaamor/knet",
"license": "MIT",
"supports": "!(arm | uwp)"
}