I am trying to compile the latest OpenCV from the master branch with OpenNI support. Here is what I tried:
cmake -DOPENNI_LIB_DIR=/opt/openni-1.5.4.0/Lib -DOPENNI_INCLUDE_DIR=/opt/openni-1.5.4.0/Include -DWITH_OPENNI=on ..
However, this results in a crude error:
WARNING, OpenNI include directory (set by OPENNI_INCLUDE_DIR variable) is not found or does not have OpenNI include files.
Setting the variables OPENNI_LIB and OPENNI_INCLUDES directly did not help either.