# Find OCULUS # # This module defines # OCULUS_MOBILE_FOUND # OCULUS_MOBILE_INCLUDE_DIRS # OCULUS_MOBILE_LIBRARIES # # Copyright (c) 2019 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(OCULUS_MOBILE_INCLUDE_DIR AND OCULUS_MOBILE_LIBRARY) SET(OCULUS_MOBILE_FIND_QUIETLY TRUE) ENDIF() # If OCULUS_MOBILE_ROOT was defined in the environment, use it. if (NOT OCULUS_MOBILE_ROOT) if(NOT "$ENV{OCULUS_MOBILE_ROOT}" STREQUAL "") set(OCULUS_MOBILE_ROOT $ENV{OCULUS_MOBILE_ROOT}) else() set(OCULUS_MOBILE_ROOT $ENV{SCOL_DEPENDENCIES_PATH}/oculus_mobile/VrApi) endif() endif() # concat all the search paths IF(OCULUS_MOBILE_ROOT) SET(OCULUS_MOBILE_INCLUDE_SEARCH_DIRS ${OCULUS_MOBILE_INCLUDE_SEARCH_DIRS} ${OCULUS_MOBILE_ROOT}/Include ) SET(OCULUS_MOBILE_LIBRARY_SEARCH_RELEASE_DIRS ${OCULUS_MOBILE_LIBRARY_SEARCH_DIRS} ${OCULUS_MOBILE_ROOT}/libs/Android/${ANDROID_ABI}/Release ) SET(OCULUS_MOBILE_LIBRARY_SEARCH_DEBUG_DIRS ${OCULUS_MOBILE_LIBRARY_SEARCH_DIRS} ${OCULUS_MOBILE_ROOT}/libs/Android/${ANDROID_ABI}/Debug ) ENDIF() # log message IF (NOT OCULUS_MOBILE_FIND_QUIETLY) MESSAGE(STATUS "Checking for OCULUS Mobile library") ENDIF() # Search for header files FIND_PATH(OCULUS_MOBILE_INCLUDE_DIR VrApi.h PATHS ${OCULUS_MOBILE_INCLUDE_SEARCH_DIRS}) # Search for libraries files (release mode) FIND_LIBRARY(OCULUS_MOBILE_LIBRARY_RELEASE libvrapi vrapi PATHS ${OCULUS_MOBILE_LIBRARY_SEARCH_RELEASE_DIRS}) # Search for libraries files (debug mode) FIND_LIBRARY(OCULUS_MOBILE_LIBRARY_DEBUG libvrapi vrapi PATHS ${OCULUS_MOBILE_LIBRARY_SEARCH_DEBUG_DIRS}) # Configure libraries for debug/release SET(OCULUS_MOBILE_INCLUDE_DIRS ${OCULUS_MOBILE_INCLUDE_DIR} CACHE STRING "Directory containing OCULUS MOBILE header files") SET(OCULUS_MOBILE_LIBRARY debug ${OCULUS_MOBILE_LIBRARY_DEBUG} optimized ${OCULUS_MOBILE_LIBRARY_RELEASE}) SET(OCULUS_MOBILE_LIBRARIES "${OCULUS_MOBILE_LIBRARY}" CACHE STRING "OCULUS MOBILE libraries files") IF(OCULUS_MOBILE_INCLUDE_DIR AND OCULUS_MOBILE_LIBRARY) SET(OCULUS_MOBILE_FOUND TRUE) ENDIF() # Hide those variables in GUI SET(OCULUS_MOBILE_INCLUDE_DIR ${OCULUS_MOBILE_INCLUDE_DIR} CACHE INTERNAL "") SET(OCULUS_MOBILE_LIBRARY_RELEASE ${OCULUS_MOBILE_LIBRARY_RELEASE} CACHE INTERNAL "") SET(OCULUS_MOBILE_LIBRARY_DEBUG ${OCULUS_MOBILE_LIBRARY_DEBUG} CACHE INTERNAL "") SET(OCULUS_MOBILE_LIBRARY ${OCULUS_MOBILE_LIBRARY} CACHE INTERNAL "") # log find result IF(OCULUS_MOBILE_FOUND) IF(NOT OCULUS_MOBILE_FIND_QUIETLY) MESSAGE(STATUS " libraries: ${OCULUS_MOBILE_LIBRARIES}") MESSAGE(STATUS " includes: ${OCULUS_MOBILE_INCLUDE_DIRS}") ENDIF() ELSE(OCULUS_MOBILE_FOUND) IF(NOT OCULUS_MOBILE_LIBRARIES) MESSAGE(STATUS, "OCULUS MOBILE library or one of it dependencies could not be found.") ENDIF() IF(NOT OCULUS_MOBILE_INCLUDE_DIRS) MESSAGE(STATUS "OCULUS MOBILE include files could not be found.") ENDIF() ENDIF(OCULUS_MOBILE_FOUND)