Skip to content

Instantly share code, notes, and snippets.

@connerbrooks
Created April 12, 2016 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save connerbrooks/380c964c765dbe7ea8e7e9aa8fba22dd to your computer and use it in GitHub Desktop.
Save connerbrooks/380c964c765dbe7ea8e7e9aa8fba22dd to your computer and use it in GitHub Desktop.
# - Find OpenNI
# This module defines
# OpenNI_INCLUDE_DIR, where to find OpenNI include files
# OpenNI_LIBRARIES, the libraries needed to use OpenNI
# OpenNI_FOUND, If false, do not try to use OpenNI.
# also defined, but not for general use are
# OpenNI_LIBRARY, where to find the OpenNI library.
set(OPEN_NI_ROOT "C:/Program\ Files/OpenNI2" CACHE FILEPATH "Root directory of OpenNI2")
# Finally the library itself
find_library(OpenNI_LIBRARY
NAMES OpenNI
PATHS "${OPEN_NI_ROOT}/Lib" "C:/Program Files (x86)/OpenNI/Lib" "C:/Program Files/OpenNI2/Lib" ${CMAKE_LIB_PATH}
)
find_path(OpenNI_INCLUDE_DIR OpenNI.h PATH "${OPEN_NI_ROOT}/Include")
find_library(OpenNI_LIBRARY OpenNI2 PATH "${OPEN_NI_ROOT}/Lib")
# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
# all listed variables are TRUE
#include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
#include(${CMAKE_MODULE_PATH}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(OpenNI DEFAULT_MSG OpenNI_LIBRARY OpenNI_INCLUDE_DIR)
if(OPENNI_FOUND)
set(OpenNI_LIBRARIES ${OpenNI_LIBRARY})
endif()
mark_as_advanced(OpenNI_LIBRARY OpenNI_INCLUDE_DIR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment