Uninstall Libfreenect from OSX 10.8

If you found this posting, I’m sorry. You may be frustrated, confused or both. I feel your pain, I was in your shoes a few days ago. The back story is; I installed libfreenect a few months ago, assuming I would only use it with Processing or openFrameworks. Then a friend of mine asked if I had ever used it with ActionScript, my response was NO, but, It got me wondering of the possibilities. I have been working with ActionScript for the past 14 years, it only seems plausible that I may one day pursue the use of Actionscript with the Kinect harware. Naturally, I started researching the ability to install the AS3-Server to my current build of libfreenect. That’s when the confusion sat in, there is so much outdated information out on the interwebs related to kinect hacking, it takes time for you to navigate through the webs. I couldn’t find correct information on a simple and clear directive to installing an AS3-Server to a current build of libfreenect, ( I have since figured it out, blog posting coming soon). I assumed the best approach was to uninstall libfreenect and start over.

My first attempt/solution was to uninstall the “build” in the libfreenect directory and re-build what I needed for the AS3 project. A no brainer, right? In theory it should be that simple. NOPE, instead it throws an error stating that there is no “CMakeLists.txt”, which is true, so the uninstall fails. I’m not really sure why libfreenect did not create a “CMakeLists.txt” file in the build folder in the first place. I researched the topic extensively and found nothing in regards to creating a CMakeList from a current libfreenect build. I felt like I had hit a dead end.

My next approach was to just uninstall libfreenect from my system and re-install it with the AS3-Server. Well that should of worked, but instead I got this error when trying to remove it:

cmake error uninstall target.cmake problem when removing “/usr/local/lib/libfreenect.0.1.2.dylib

Which means nothing to me! I mean, I understand the error, but I couldn’t figure out how to resolve it. If you are reading this and have resolved the error, please post a fix in my comments section, thank you!

So, have you tried to uninstall libfreenect?  Would you like to know how to uninstall libfreenect? Here’s how you do it, hopefully you don’t run into the error.

*NOTE – Where ever you see ‘manuelgonzalez” please substitue with your own username.

To attempt to get libfreenect uninstalled from your system, fire up Terminal, and cd to your libfreenect folder  (ex: /Users/manuelgonzalez/libfreenect) by typing:

cd /Users/manuelgonzalez/libfreenect

now type:


This will list all the files in the /Users/’your_user_name’/libfreenect directory, one of them being UninstallTarget.cmake

Next type:

cmake -P /Users/manuelgonzalez/libfreenect/UninstallTarget.cmake

Now if all went well for you, you should have successfully uninstalled libfreenect, lucky you, you are done. If you want to re-install librfreenect continue reading.

As I mentioned earlier, I was not lucky in the uninstall procedure, my machine had issues. I decided to uninstall libfreenect with brut force. Now, I’m not sure how this will effect you and your system, so take heed, I’m not responsible for your actions, follow at your own risk. Just to reassure you, after I performed my brut force removal successfully, I was up and running with out problems. I initiated some simple tests, using the glView app and Processing with the openkinect library, every thing checked out fine.

So, what did I do? I simply navigated to the libfreenect folder on my system (ex:/Users/manuelgonzalez/libfreenect) and deleted the libfreenect folder. I did not use Terminal to do this, I simply typed libfreenect in my search bar, which resulted in finding my /Users/manuelgonzalez/libfreenect folder I opened up the path in finder and threw it away, empty trash. GONE!

My next step was to re-install it. So, I fired up Terminal and typed:

cd /Users/manuelgonzalez

to navigate to the folder. Next I typed:


to check the contents of the folder, and to validate the libfreenect folder had been deleted. Just to make sure I was in the correct folder I typed:


Which responded correctly with “/Users/manuelgonzalez” , once again a check and balance test! I proceeded with making a new libfreenect directory by typing:

mkdir libfreenect

Once again I wanted to check my work, by typing:


which listed out my files and validated the “libfreenect” newly created directory. I proceeded by getting the latest source of libfreenect from git-hub, by typing:

git clone git://github.com/OpenKinect/libfreenect.git

and now I was ready to install. Compare your output with mine, you shouldn’t have any errors at this point.

Screen Shot 2013-04-10 at 9.38.40 PM

I proceeded by typing:

cd /Users/manuelgonzalez/libfreenect

and then typed:


this validated that there where only make files in the libfreenect folder, which is exactly what I expected.

I proceeded to type:

ccmake /Users/manuelgonzalez/libfreenect

which spawned and empty cache window,  ignore the empty cache message and proceed by selecting the ‘c’ key to configure.


You should now be in the configure view for libfreenect.

Screen Shot 2013-04-10 at 9.52.28 PM

If all checks out, press ‘c’ key twice or until you get the Press ‘g’ to generate and exit command. Select the ‘g’key. This will close the configuration window and proceed by typing:


This will output a bunch of text which mainly scans for dependencies, links executables and builds:

Scanning dependencies of target freenect
[ 4%] Building C object src/CMakeFiles/freenect.dir/core.c.o
[ 9%] Building C object src/CMakeFiles/freenect.dir/tilt.c.o
[ 14%] Building C object src/CMakeFiles/freenect.dir/cameras.c.o
/Users/manuelgonzalez/libfreenect/src/cameras.c:750:17: warning: unused function
‘read_register’ [-Wunused-function]
static uint16_t read_register(freenect_device *dev, uint16_t reg)
1 warning generated.
[ 19%] Building C object src/CMakeFiles/freenect.dir/usb_libusb10.c.o
[ 23%] Building C object src/CMakeFiles/freenect.dir/registration.c.o
Linking C shared library ../lib/libfreenect.dylib
[ 23%] Built target freenect
Scanning dependencies of target freenectstatic
[ 28%] Building C object src/CMakeFiles/freenectstatic.dir/core.c.o
[ 33%] Building C object src/CMakeFiles/freenectstatic.dir/tilt.c.o
[ 38%] Building C object src/CMakeFiles/freenectstatic.dir/cameras.c.o
/Users/manuelgonzalez/libfreenect/src/cameras.c:750:17: warning: unused function
‘read_register’ [-Wunused-function]
static uint16_t read_register(freenect_device *dev, uint16_t reg)
1 warning generated.
[ 42%] Building C object src/CMakeFiles/freenectstatic.dir/usb_libusb10.c.o
[ 47%] Building C object src/CMakeFiles/freenectstatic.dir/registration.c.o
Linking C static library ../lib/libfreenect.a
[ 47%] Built target freenectstatic
Scanning dependencies of target freenect_sync
[ 52%] Building C object wrappers/c_sync/CMakeFiles/freenect_sync.dir/libfreenect_sync.c.o
Linking C shared library ../../lib/libfreenect_sync.dylib
[ 52%] Built target freenect_sync
Scanning dependencies of target glpclview
[ 57%] Building C object examples/CMakeFiles/glpclview.dir/glpclview.c.o
Linking C executable ../bin/glpclview
[ 57%] Built target glpclview
Scanning dependencies of target glview
[ 61%] Building C object examples/CMakeFiles/glview.dir/glview.c.o
Linking C executable ../bin/glview
[ 61%] Built target glview
Scanning dependencies of target hiview
[ 66%] Building C object examples/CMakeFiles/hiview.dir/hiview.c.o
Linking C executable ../bin/hiview
[ 66%] Built target hiview
Scanning dependencies of target regtest
[ 71%] Building C object examples/CMakeFiles/regtest.dir/regtest.c.o
Linking C executable ../bin/regtest
[ 71%] Built target regtest
Scanning dependencies of target regview
[ 76%] Building C object examples/CMakeFiles/regview.dir/regview.c.o
Linking C executable ../bin/regview
[ 76%] Built target regview
Scanning dependencies of target tiltdemo
[ 80%] Building C object examples/CMakeFiles/tiltdemo.dir/tiltdemo.c.o
Linking C executable ../bin/tiltdemo
[ 80%] Built target tiltdemo
Scanning dependencies of target fakenect
[ 85%] Building C object fakenect/CMakeFiles/fakenect.dir/fakenect.c.o
Linking C shared library ../lib/fakenect/libfreenect.dylib
[ 85%] Built target fakenect
Scanning dependencies of target record
[ 90%] Building C object fakenect/CMakeFiles/record.dir/record.c.o
Linking C executable ../bin/record
[ 90%] Built target record
Scanning dependencies of target freenect_sync_static
[ 95%] Building C object wrappers/c_sync/CMakeFiles/freenect_sync_static.dir/libfreenect_sync.c.o
Linking C static library ../../lib/libfreenect_sync.a
[ 95%] Built target freenect_sync_static
Scanning dependencies of target cppview
[100%] Building CXX object wrappers/cpp/CMakeFiles/cppview.dir/cppview.cpp.o
Linking CXX executable ../../bin/cppview
[100%] Built target cppview
unknown949426026da4:~ manuelgonzalez$

proceed with typing:

sudo make install

type in your admin password and you should have something similar to this:

Screen Shot 2013-04-10 at 10.51.18 PM

and your done. The only thing left to do is test the build out, so grab your Kinect and hook it up to your machine.


sudo glview

type in your user password and you should see something similar to this  in terminal and the glaring obvious the gl view screen

Screen Shot 2013-04-10 at 10.58.50 PM

Give it a whirl by testing out the commands in Terminal at least try the ‘w’ key!

There you have it uninstalling libfreenect with brut force and re-installing it. If you have any questions, or revisions please leave them in the comments section, thank, till next time.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: