Closed sabrinazuraimi closed 5 years ago
By the way, my UseOpenNI.cmake is as below
###################
# UseOpenNI.cmake #
###################
OPTION(WITH_OPENNI "Build with OpenNI support?" OFF)
IF(WITH_OPENNI)
IF(MSVC_IDE)
FIND_PATH(OPENNI_ROOT LICENSE HINTS "C:/Program Files/OpenNI2")
ELSEIF(APPLE)
FIND_PATH(OPENNI_ROOT primesense-usb.rules HINTS ~/Downloads/OpenNI-MacOSX-x64-2.2)
ELSEIF("${CMAKE_SYSTEM}" MATCHES "Linux")
FIND_PATH(OPENNI_ROOT LICENSE HINTS ~/Software/OpenNI2)
ELSE()
MESSAGE(FATAL_ERROR "OpenNI not currently set up to work on this platform.")
ENDIF()
FIND_PATH(OPENNI_INCLUDE_DIR OpenNI.h HINTS "${OPENNI_ROOT}/include/openni2")
FIND_LIBRARY(OPENNI_LIBRARY OpenNI2 HINTS "${OPENNI_ROOT}/Bin/x64-Release" "${OPENNI_ROOT}/lib" "${OPENNI_ROOT}/Redist")
INCLUDE_DIRECTORIES(${OPENNI_INCLUDE_DIR})
ELSE()
ADD_DEFINITIONS(-DCOMPILE_WITHOUT_OpenNI)
ENDIF()
Are you being bitten by the difference between OPENNI_ROOT and OPEN_NI_ROOT by any chance?
The script is written to find a downloaded and extracted version of OpenNI2, not a centralised one. It might be better if it did something else, but in the short term you can fix it by downloading and extracting OpenNI2 somewhere and setting OPENNI_ROOT to the root folder of that.
Note that FindOpenNI.cmake is never actually used as things stand - so its contents are actually irrelevant to the problem you're having.
Oh yeah, that fixed it, also I forgot to change the boolean for "Build with OpenNI support?" to ON..
That helps too :) Glad it works now!
Hi, I'm currently trying to run this on Ubuntu16.04, I have my OpenNI2 library in /usr/lib/OpenNI2 and the include file is in /usr/include . I modified my FindOpenNI.cmake as such
And then I ran the cmake build with this command
cmake /home/muser/Desktop/InfiniTAM-master/InfiniTAM -DOPEN_NI_ROOT=/usr
However, I got an error saying
How is this so? As far as I know, my path is correct..