Skip to content

Add vcpkg installation instructions - #660

Open
LilyWangLL wants to merge 1 commit into
OpenKinect:masterfrom
LilyWangLL:vcpkg-instructions
Open

LilyWangLL wants to merge 1 commit into
OpenKinect:masterfrom
LilyWangLL:vcpkg-instructions

Conversation

@LilyWangLL

Copy link
Copy Markdown

Libfreenect is available as a port in vcpkg, a C++ library manager that simplifies installation for libfreenect and other project dependencies. Documenting the install process here will help users get started by providing a single set of commands to build libfreenect, ready to be included in their projects.

We also test whether our library ports build in various configurations (dynamic, static) on various platforms (OSX, Linux, Windows: x86, x64, UWP, ARM) to keep a wide coverage for users.

I'm a maintainer for vcpkg, and here is what the port script looks like. We try to keep the library maintained as close as possible to the original library.

kebasaa added a commit to kebasaa/libfreenect that referenced this pull request Nov 6, 2026
libfreenect had no CI. The workflow builds the library, the C sync
and C++ wrappers and the examples, including the OpenGL viewers, on:
- Windows x64 and ARM64 with MSVC, with libusb and freeglut from vcpkg;
- Ubuntu 24.04 on x86_64 and arm64;
- macOS on Apple Silicon.

Each job then runs smoke tests that need no Kinect: freenect-fwloader
must report that no Kinect is present. On Windows x64 the job also
checks that freenect-driver-install --list works and that
--package-only produces a catalog signed by the package certificate
with the key destroyed. The Windows jobs upload their binaries as
artifacts (OpenKinect#622).

vcpkg.json declares libusb, and freeglut for the examples behind the
"examples" feature, so a Windows build needs only
-DCMAKE_TOOLCHAIN_FILE=<vcpkg>/scripts/buildsystems/vcpkg.cmake (OpenKinect#660).

Two fixes the Windows builds needed:
- Findlibusb-1.0.cmake now also accepts the library name libusb-1.0,
  which is what vcpkg and the official Windows binaries ship
  (libusb-1.0.lib). Before, CMake could not find libusb on Windows
  without -DLIBUSB_1_LIBRARY (OpenKinect#647).
- MSVC builds define _USE_MATH_DEFINES, because glview uses M_PI.

Checked locally with MSVC 14.51: configuring with only CMAKE_PREFIX_PATH
pointing at a vcpkg-style libusb layout finds the library, everything
builds, and the Windows smoke steps pass. The workflow itself has not
run yet; the OpenGL viewers and the Linux and macOS jobs are untested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant