aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/hidapi
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/hidapi')
-rw-r--r--vcpkg/ports/hidapi/portfile.cmake38
-rw-r--r--vcpkg/ports/hidapi/vcpkg.json29
2 files changed, 67 insertions, 0 deletions
diff --git a/vcpkg/ports/hidapi/portfile.cmake b/vcpkg/ports/hidapi/portfile.cmake
new file mode 100644
index 0000000..8ebfe77
--- /dev/null
+++ b/vcpkg/ports/hidapi/portfile.cmake
@@ -0,0 +1,38 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO libusb/hidapi
+ REF hidapi-${VERSION}
+ SHA512 a4ddd13a80a84956872fa52aa861b40e4959f301d8d91afe0feaf9dbd87394561e1fdd20cbf8cf47200845f80a8db8a934bc2e3025fe6f16435e37c17621e7b6
+ HEAD_REF master
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+FEATURES
+ "pp-data-dump" HIDAPI_BUILD_PP_DATA_DUMP
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DHIDAPI_BUILD_HIDTEST=OFF
+ -DHIDAPI_WITH_TESTS=OFF
+ ${FEATURE_OPTIONS}
+ MAYBE_UNUSED_VARIABLES
+ # Windows only
+ HIDAPI_BUILD_PP_DATA_DUMP
+ HIDAPI_WITH_TESTS
+)
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+if ("pp-data-dump" IN_LIST FEATURES)
+ vcpkg_copy_tools(TOOL_NAMES pp_data_dump AUTO_CLEAN)
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE-bsd.txt")
diff --git a/vcpkg/ports/hidapi/vcpkg.json b/vcpkg/ports/hidapi/vcpkg.json
new file mode 100644
index 0000000..0f035c9
--- /dev/null
+++ b/vcpkg/ports/hidapi/vcpkg.json
@@ -0,0 +1,29 @@
+{
+ "name": "hidapi",
+ "version-semver": "0.15.0",
+ "port-version": 1,
+ "description": "A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac and Windows.",
+ "homepage": "https://github.com/libusb/hidapi",
+ "license": "BSD-3-Clause-Clear",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "libusb",
+ "platform": "!(windows | osx)"
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "pp-data-dump": {
+ "description": "Build pp_data_dump.exe tool, to store WIN32 HidD Preparsed Data as file",
+ "supports": "windows"
+ }
+ }
+}