aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libfreenect2
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/libfreenect2
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libfreenect2')
-rw-r--r--vcpkg/ports/libfreenect2/fix-dependency-libusb.patch31
-rw-r--r--vcpkg/ports/libfreenect2/fix-macbuild.patch22
-rw-r--r--vcpkg/ports/libfreenect2/portfile.cmake55
-rw-r--r--vcpkg/ports/libfreenect2/vcpkg.json45
4 files changed, 153 insertions, 0 deletions
diff --git a/vcpkg/ports/libfreenect2/fix-dependency-libusb.patch b/vcpkg/ports/libfreenect2/fix-dependency-libusb.patch
new file mode 100644
index 0000000..f8f2104
--- /dev/null
+++ b/vcpkg/ports/libfreenect2/fix-dependency-libusb.patch
@@ -0,0 +1,31 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3648fb5..43c3d28 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -91,7 +91,7 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
+
+ # dependencies
+ FIND_PACKAGE(PkgConfig) # try find PKGConfig as it will be used if found
+-FIND_PACKAGE(LibUSB REQUIRED)
++pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0)
+
+ # Add includes
+ INCLUDE_DIRECTORIES(
+@@ -99,7 +99,7 @@ INCLUDE_DIRECTORIES(
+ "${MY_DIR}/include/internal"
+ ${PROJECT_BINARY_DIR} # for generated headers
+ ${LIBFREENECT2_THREADING_INCLUDE_DIR}
+- ${LibUSB_INCLUDE_DIRS}
++ ${libusb_INCLUDE_DIRS}
+ )
+
+ SET(RESOURCES_INC_FILE "${PROJECT_BINARY_DIR}/resources.inc.h")
+@@ -157,7 +157,7 @@ SET(SOURCES
+ )
+
+ SET(LIBRARIES
+- ${LibUSB_LIBRARIES}
++ PkgConfig::libusb
+ ${LIBFREENECT2_THREADING_LIBRARIES}
+ )
+
diff --git a/vcpkg/ports/libfreenect2/fix-macbuild.patch b/vcpkg/ports/libfreenect2/fix-macbuild.patch
new file mode 100644
index 0000000..cb675a6
--- /dev/null
+++ b/vcpkg/ports/libfreenect2/fix-macbuild.patch
@@ -0,0 +1,22 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index aedc576..4f16abc 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -165,6 +165,8 @@ SET(LIBFREENECT2_DLLS
+ SET(HAVE_VideoToolbox "no (Apple only)")
+ IF(APPLE)
+ FIND_LIBRARY(VIDEOTOOLBOX_LIBRARY VideoToolbox)
++ FIND_LIBRARY(CF_LIBRARY CoreFoundation)
++ FIND_LIBRARY(IOK_LIBRARY IOKit)
+
+ SET(HAVE_VideoToolbox no)
+ IF(VIDEOTOOLBOX_LIBRARY)
+@@ -184,6 +186,8 @@ IF(APPLE)
+ ${COREFOUNDATION_LIBRARY}
+ ${COREMEDIA_LIBRARY}
+ ${COREVIDEO_LIBRARY}
++ ${CF_LIBRARY}
++ ${IOK_LIBRARY}
+ )
+ ENDIF(VIDEOTOOLBOX_LIBRARY)
+ ENDIF(APPLE)
diff --git a/vcpkg/ports/libfreenect2/portfile.cmake b/vcpkg/ports/libfreenect2/portfile.cmake
new file mode 100644
index 0000000..efc6c99
--- /dev/null
+++ b/vcpkg/ports/libfreenect2/portfile.cmake
@@ -0,0 +1,55 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO OpenKinect/libfreenect2
+ REF "v${VERSION}"
+ SHA512 0fcee5471deb013d2b57581ef8d8838f652dfed2f457c4240d5b754674e949c59337a167ac74ad04b25ace69af470a7e014e0474a688d930a3323946feadee67
+ HEAD_REF master
+ PATCHES
+ fix-dependency-libusb.patch
+ fix-macbuild.patch
+)
+
+file(READ "${SOURCE_PATH}/cmake_modules/FindLibUSB.cmake" FINDLIBUSB)
+string(REPLACE "(WIN32)"
+ "(WIN32_DISABLE)" FINDLIBUSB "${FINDLIBUSB}")
+file(WRITE "${SOURCE_PATH}/cmake_modules/FindLibUSB.cmake" "${FINDLIBUSB}")
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ opengl ENABLE_OPENGL
+ opencl ENABLE_OPENCL
+ openni2 BUILD_OPENNI2_DRIVER
+)
+
+vcpkg_find_acquire_program(PKGCONFIG)
+
+if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ set(path_suffix "/debug")
+endif()
+if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ set(path_suffix "")
+endif()
+vcpkg_backup_env_variables(VARS PKG_CONFIG_PATH)
+vcpkg_host_path_list(PREPEND ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}${path_suffix}/lib/pkgconfig")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
+ -DENABLE_CUDA=OFF
+ -DBUILD_EXAMPLES=OFF
+ ${FEATURE_OPTIONS}
+)
+vcpkg_restore_env_variables(VARS PKG_CONFIG_PATH)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(PACKAGE_NAME freenect2 CONFIG_PATH lib/cmake/freenect2)
+
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/GPL2")
+
+vcpkg_fixup_pkgconfig()
diff --git a/vcpkg/ports/libfreenect2/vcpkg.json b/vcpkg/ports/libfreenect2/vcpkg.json
new file mode 100644
index 0000000..c8f3262
--- /dev/null
+++ b/vcpkg/ports/libfreenect2/vcpkg.json
@@ -0,0 +1,45 @@
+{
+ "name": "libfreenect2",
+ "version": "0.2.1",
+ "port-version": 2,
+ "description": "Open source drivers for the Kinect for Windows v2 device",
+ "homepage": "https://github.com/OpenKinect/libfreenect2",
+ "license": "GPL-2.0-only OR Apache-2.0",
+ "supports": "!xbox",
+ "dependencies": [
+ "libjpeg-turbo",
+ "libusb",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "default-features": [
+ "opengl"
+ ],
+ "features": {
+ "opencl": {
+ "description": "OpenCL support for libfreenect2",
+ "dependencies": [
+ "opencl"
+ ]
+ },
+ "opengl": {
+ "description": "OpenGL support for libfreenect2",
+ "dependencies": [
+ "glfw3",
+ "opengl"
+ ]
+ },
+ "openni2": {
+ "description": "OpenNI2 support for libfreenect2",
+ "dependencies": [
+ "openni2"
+ ]
+ }
+ }
+}