title: How do I solve this OpenNi dependency error in PCL when using the Kinect?
body: <p>Although I've just signed up for Stackoverflow, I've used answers.ros.org, pcl-users.org, and other similar sites.  I'll try to give as much information as possible because although similar problems come up in Google searches I cannot find an answer to this.</p>
  
  <p>I'm running Ubuntu 12.04 and I've installed PCL 1.7 via their set of instructions here: <strong>http:// pointclouds.org/downloads/linux.html</strong></p>
  
  <p>Following the tutorials I was able to get the "reader" and "writer" sample programs to work with the sample PCD's they give.  I was also able to successfully use cmake to compile a more advanced program: <a href="http://pointclouds.org/documentation/tutorials/normal_distributions_transform.php#normal-distributions-transform" rel="nofollow">http://pointclouds.org/documentation/tutorials/normal_distributions_transform.php#normal-distributions-transform</a></p>
  
  <p>The problem begins whenever I try to make the iograbber or any other visualization programs that involve the Kinect.  This is specifically the one I really want to use: <a href="http://pointclouds.org/documentation/tutorials/openni_grabber.php#openni-grabber" rel="nofollow">http://pointclouds.org/documentation/tutorials/openni_grabber.php#openni-grabber</a>  Repeatedly, without fail, this has always been the warning I encounter when using cmake:</p>
  
  <p>-- checking for module 'openni-dev'</p>
  
  <p>-- package 'openni-dev' not found</p>
  
  <p>-- Could NOT find openni (missing:  OPENNI_INCLUDE_DIRS) </p>
  
  <p>** WARNING ** io features related to openni will be disabled</p>
  
  <p>It gives this warning several times in a row related to various components checking for it.  Now you might say, "silly user, why don't you simply install openni-dev?"</p>
  
  <p>Well when I initially did it with sudo apt-get install -y openni-dev (notice the -y which I soon learned about) it deleted most of my ROS/PCL files.  Thread is here: <strong>http:// www.pcl-users.org/How-can-I-get-PCD-files-from-a-streaming-Kinect-td4033721.html</strong>  It broke some packages and long story short I found out about aptitude and eventually I got myself back to square 1.</p>
  
  <p>The thing is, I'm fairly sure I have openni 1.5.4 installed but somehow it isn't being found. When I go to my usr/lib folder it only shows an OpenNI2 folder, and not an OpenNI folder.  I know there's a lot of issues with openni-dev popping up for PCL and ROS so I hope this answer will be able to help others as well. Before you ask, I'm copying/pasting the CMakeLists and C++ files exactly as I find it.  I don't have a lot of programming experience so I hope I'm not missing something obvious.</p>