aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/webthing-cpp
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/webthing-cpp
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/webthing-cpp')
-rw-r--r--vcpkg/ports/webthing-cpp/portfile.cmake28
-rw-r--r--vcpkg/ports/webthing-cpp/usage13
-rw-r--r--vcpkg/ports/webthing-cpp/vcpkg.json30
3 files changed, 71 insertions, 0 deletions
diff --git a/vcpkg/ports/webthing-cpp/portfile.cmake b/vcpkg/ports/webthing-cpp/portfile.cmake
new file mode 100644
index 0000000..7cb89d8
--- /dev/null
+++ b/vcpkg/ports/webthing-cpp/portfile.cmake
@@ -0,0 +1,28 @@
+set(VCPKG_BUILD_TYPE release) # header-only
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO bw-hro/webthing-cpp
+ REF "v${VERSION}"
+ SHA512 f4b854d9d363c4b3590232da31a150b3b4a3fb9150cd32558240b02ccf9c8453e79d2330c04076332927c5d488cc5b09ff28a40f225af21f52bd1eac7a4c421a
+ HEAD_REF master
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ ssl WT_WITH_SSL
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DWT_BUILD_EXAMPLES=OFF
+ -DWT_BUILD_TESTS=OFF
+)
+
+vcpkg_cmake_install()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
diff --git a/vcpkg/ports/webthing-cpp/usage b/vcpkg/ports/webthing-cpp/usage
new file mode 100644
index 0000000..47ba628
--- /dev/null
+++ b/vcpkg/ports/webthing-cpp/usage
@@ -0,0 +1,13 @@
+
+webthing-cpp is header-only and can be used from CMake via:
+
+ find_path(WEBTHING_CPP_INCLUDE_DIRS "bw/webthing/webthing.hpp")
+ target_include_directories(main PRIVATE ${WEBTHING_CPP_INCLUDE_DIRS})
+
+However it requires
+
+ find_package(nlohmann_json_schema_validator CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE nlohmann_json_schema_validator::validator)
+
+ find_package(unofficial-uwebsockets CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE unofficial::uwebsockets::uwebsockets)
diff --git a/vcpkg/ports/webthing-cpp/vcpkg.json b/vcpkg/ports/webthing-cpp/vcpkg.json
new file mode 100644
index 0000000..fd035ee
--- /dev/null
+++ b/vcpkg/ports/webthing-cpp/vcpkg.json
@@ -0,0 +1,30 @@
+{
+ "name": "webthing-cpp",
+ "version": "1.2.0",
+ "description": "Webthing-CPP is a modern CPP/C++17 implementation of the WebThings API.",
+ "homepage": "https://github.com/bw-hro/webthing-cpp",
+ "license": "MIT",
+ "dependencies": [
+ "json-schema-validator",
+ "mdns",
+ "nlohmann-json",
+ "uwebsockets",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ],
+ "features": {
+ "ssl": {
+ "description": "Support HTTPS via uwebsockets",
+ "dependencies": [
+ {
+ "name": "uwebsockets",
+ "features": [
+ "ssl"
+ ]
+ }
+ ]
+ }
+ }
+}