diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/netcpp | |
Diffstat (limited to 'vcpkg/ports/netcpp')
| -rw-r--r-- | vcpkg/ports/netcpp/portfile.cmake | 33 | ||||
| -rw-r--r-- | vcpkg/ports/netcpp/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/netcpp/vcpkg.json | 22 |
3 files changed, 59 insertions, 0 deletions
diff --git a/vcpkg/ports/netcpp/portfile.cmake b/vcpkg/ports/netcpp/portfile.cmake new file mode 100644 index 0000000..088d95d --- /dev/null +++ b/vcpkg/ports/netcpp/portfile.cmake @@ -0,0 +1,33 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO index1207/netcpp + REF "v${VERSION}" + SHA512 5f0c7a9ad414b868c23cde4c16a605c2029631935b252b3faa4e485ec1efa3dbfe64fd0b068db8e018481b6ac83f819facc1db371470be42c6919fcf69005e17 + HEAD_REF release +) + +set(options -DNETCPP_TEST=OFF) + +vcpkg_find_acquire_program(PKGCONFIG) +list(APPEND options "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}") + +if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "dynamic") + list(APPEND options -DNETCPP_BUILD_SHARED=ON) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${options} + MAYBE_UNUSED_VARIABLES + PKG_CONFIG_EXECUTABLE +) + +vcpkg_cmake_install() +vcpkg_fixup_pkgconfig() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/netcpp PACKAGE_NAME netcpp) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + +configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY) diff --git a/vcpkg/ports/netcpp/usage b/vcpkg/ports/netcpp/usage new file mode 100644 index 0000000..b199e5b --- /dev/null +++ b/vcpkg/ports/netcpp/usage @@ -0,0 +1,4 @@ +netcpp provides CMake targets: + + find_package(netcpp CONFIG REQUIRED) + target_link_libraries(main PRIVATE netcpp::netcpp) diff --git a/vcpkg/ports/netcpp/vcpkg.json b/vcpkg/ports/netcpp/vcpkg.json new file mode 100644 index 0000000..4d5bfc3 --- /dev/null +++ b/vcpkg/ports/netcpp/vcpkg.json @@ -0,0 +1,22 @@ +{ + "name": "netcpp", + "version": "0.5.0", + "description": "A simple asynchronous network library", + "homepage": "https://github.com/index1207/netcpp", + "license": "MIT", + "supports": "windows | linux", + "dependencies": [ + { + "name": "liburing", + "platform": "linux" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |