I’ve been trying to run the “tutorial to get started” with the Kinect libraries (http://nicolas.burrus.name/index.php/Research/KinectUseNestk) but I stumbled across an error.
When I try the following line in the CLI:
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
I get the following error:
CMake Error at D:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHan
dleStandardArgs.cmake:91 (MESSAGE):
Could NOT find OpenNI (missing: OPENNI_LIBRARY OPENNI_INCLUDE_DIR)
Call Stack (most recent call first):
D:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardAr
gs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
nestk/cmake/FindOpenNI.cmake:51 (find_package_handle_standard_args)
nestk/cmake/find_nestk_deps.cmake:77 (FIND_PACKAGE)
build/nestk/UseEmbeddedNestk.cmake:23 (INCLUDE)
nestk/CMakeLists.txt:67 (INCLUDE)
Does anyone have any idea how I have to solve this? I’ve installed OpenNI, it’s installed at D:\Program Files\OpenNI.
You could try to modify the CMakeLists.txt file and add or modify the following lines
Otherwise, look for a file named CMakeCache.txt inside the binaries folder. Look for OPENNI_INCLUDE_DIR and OPENNI_LIB_DIR, set the right path, and run cmake again.
If none of those work, and you can run cmake-gui, try to use it instead of the cli command and manually specify those paths in the GUI.
I hope it helps!
Typical openni2 distribution has following file /OpenNI-Linux-Arm-2.2/OpenNIDevEnvironment
It has described all necessary variables to compile and link:
So you need to export these variables and then run the cmake with OpenNI2 enabled:
Somewhere in cmake result you should see:
-- OpenNI2: YES (ver 2.2.0, build 33)
For biulding an OpenNI project with CMAKE you can wirte this in your cmakelists. It works fine. (I also included NITE2, but if you don't needed just delete those lines).
And later you need to link the directories and libs found:
Make sure OPEN_NI_BIN, OPEN_NI_INCLUDE, OPEN_NI_INSTALL_PATH environment variables are all set and that they point to the right place, because the cmake module that checks for OPEN_NI checks those values. I was getting the same error, but in my case, it was a problem mixing 64 and 32 bit libraries. I was building opencv with 32 bit compilers, but OpenNI was 64 bit. So I uninstalled all 64bit and left only 32 bit versions, which made it work.
Kind regards, Daniel