Installing Libfreenect from Homebrew without the fuss

I managed to get my hands on a Kinect and I’m now playing with it. While in Ubuntu a simple 3 line command sequence allowed me to play with OpenKinect without problems,

$ sudo add-apt-repository ppa:arne-alamut/freenect
$ sudo apt-get update
$ sudo apt-get install freenect

in the Mac (10.5.8), things got rough. The problem? Well, the problem was compiling cmake… It failed constantly.

The solution for those that couldn’t install openkinect in Leopard (might work also for other versions)?

Download cmake directly from their website

Install Homebrew (it’s better than Macports and Fink)

Download the Formulas

cd /usr/local/Library/Formula
curl --insecure -O \
  "https://github.com/OpenKinect/libfreenect/raw/master/platform/osx/homebrew/libfreenect.rb"
curl --insecure -O \
  "https://github.com/OpenKinect/libfreenect/raw/master/platform/osx/homebrew/libusb-freenect.rb"

And now it is a bit different from what the tutorial says. Instead of running the brew install command use brew edit

$ brew edit libfreenect

This will open your favorite editor and then comment the line that has the cmake dependency (add # at the beginning of the line)

#  depends_on 'cmake'

Now save and install with

$ brew install libfreenect

This was the way I solved it… may not work for all of you trying to use the Microsoft Kinect with OpenKinect, but at least might help some to bypass the problems.