Building libfreenect with patched libusb under Mac OS X

Prerequisites

  • macports
  • The following installed macports:
    • git-core
    • cmake
    • libtool
    • libusb-devel

Get the sources

  • libfreenect:
    • git clone https://github.com/OpenKinect/libfreenect.git
  • libusb:
    • git clone git://git.libusb.org/libusb.git

Apply the patch and build libusb

  1. cd path/to/libusb
  2. ./autogen.sh
  3. patch -p1 < path/to/libfreenect/platform/osx/libusb-osx-kinect.diff
  4. ./configure LDFLAGS=’-framework IOKit -framework CoreFoundation’
  5. make
  6. sudo make install

Start building libfreenect

  1. cd path/to/libfreenect
  2. mkdir build
  3. cd build
  4. ccmake ..
      With the following changes:

    • LIBUSB_1_INCLUDE_DIR: /usr/local/include
    • LIBUSB_1_LIBRARY: /usr/local/lib/libusb-1.0.dylib
  5. press ‘c’ and afterwards ‘g’ to generate and exit
  6. cmake ..
  7. make
  8. sudo make install
Advertisements
Building libfreenect with patched libusb under Mac OS X