# Find OpenNi # # This module defines # OpenNi_FOUND # OpenNi_INCLUDE_DIRS # OpenNi_LIBRARIES # # Copyright (c) 2012 I-maginer # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA, or go to # http://www.gnu.org/copyleft/lesser.txt # # On a new cmake run, we do not need to be verbose IF(OpenNi_INCLUDE_DIR AND OpenNi_LIBRARY) SET(OpenNi_FIND_QUIETLY TRUE) ENDIF() if(WIN32 AND (WIN64 OR (CMAKE_SIZEOF_VOID_P EQUAL 8))) set(OPENNI_SDK_DIR "$ENV{SCOL_DEPENDENCIES_PATH}/OpenNI2/x64" CACHE PATH "OPENNI SDK path" FORCE) elseif(WIN32) set(OPENNI_SDK_DIR "$ENV{SCOL_DEPENDENCIES_PATH}/OpenNI2/x86" CACHE PATH "OPENNI SDK path" FORCE) endif() # log message IF (NOT OpenNi_FIND_QUIETLY) MESSAGE(STATUS "Checking for OpenNi SDK") ENDIF() # Search for header files FIND_PATH(OpenNi_INCLUDE_DIR OpenNI.h PATHS ${OPENNI_SDK_DIR}/Include) # Search for libraries files FIND_LIBRARY(OpenNi_LIBRARY openNI2 PATHS ${OPENNI_SDK_DIR}/Lib) # Configure libraries SET(OpenNi_INCLUDE_DIRS ${OpenNi_INCLUDE_DIR} CACHE STRING "Directory containing OpenNi SDK header files") SET(OpenNi_LIBRARIES ${OpenNi_LIBRARY} CACHE STRING "OpenNi SDK libraries files") # Hide those variables in GUI SET(OpenNi_INCLUDE_DIR ${OpenNi_INCLUDE_DIR} CACHE INTERNAL "") SET(OpenNi_LIBRARY ${OpenNi_LIBRARY} CACHE INTERNAL "") IF(OpenNi_INCLUDE_DIRS AND OpenNi_LIBRARY) SET(OpenNi_FOUND TRUE) ENDIF() # log find result IF(OpenNi_FOUND) IF(NOT OpenNi_FIND_QUIETLY) MESSAGE(STATUS " libraries: ${OpenNi_LIBRARIES}") MESSAGE(STATUS " includes: ${OpenNi_INCLUDE_DIRS}") ENDIF() ELSE(OpenNi_FOUND) IF(NOT OpenNi_LIBRARIES) MESSAGE(STATUS, "OpenNi SDK library files could not be found") ENDIF() IF(NOT OpenNi_INCLUDE_DIRS) MESSAGE(STATUS "OpenNi SDK include files could not be found") ENDIF() ENDIF(OpenNi_FOUND)