8
# Copyright (c) 2012 I-maginer
10
# This program is free software; you can redistribute it and/or modify it under
11
# the terms of the GNU Lesser General Public License as published by the Free Software
12
# Foundation; either version 2 of the License, or (at your option) any later
15
# This program is distributed in the hope that it will be useful, but WITHOUT
16
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
19
# You should have received a copy of the GNU Lesser General Public License along with
20
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21
# Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22
# http://www.gnu.org/copyleft/lesser.txt
25
# On a new cmake run, we do not need to be verbose
26
IF(OCULUS_INCLUDE_DIR AND OCULUS_LIBRARY)
27
SET(OCULUS_FIND_QUIETLY FALSE)
30
# If OCULUS_ROOT was defined in the environment, use it.
32
if(NOT "$ENV{OCULUS_ROOT}" STREQUAL "")
33
set(OCULUS_ROOT $ENV{OCULUS_ROOT})
35
set(OCULUS_ROOT $ENV{SCOL_DEPENDENCIES_PATH}/oculus/LibOVR)
39
# concat all the search paths
41
SET(OCULUS_INCLUDE_SEARCH_DIRS
42
${OCULUS_INCLUDE_SEARCH_DIRS}
43
${OCULUS_ROOT}/include
45
SET(OCULUS_LIBRARY_SEARCH_RELEASE_DIRS
46
${OCULUS_LIBRARY_SEARCH_DIRS}
47
${OCULUS_ROOT}/Lib/x64/VS2012
49
SET(OCULUS_LIBRARY_SEARCH_DEBUG_DIRS
50
${OCULUS_LIBRARY_SEARCH_DIRS}
51
${OCULUS_ROOT}/Lib/x64/VS2012
56
IF (NOT OCULUS_FIND_QUIETLY)
57
MESSAGE(STATUS "Checking for OCULUS library")
60
# Search for header files
61
FIND_PATH(OCULUS_INCLUDE_DIR OVR.h
62
PATHS ${OCULUS_INCLUDE_SEARCH_DIRS})
64
# Search for libraries files (release mode)
65
FIND_LIBRARY(OCULUS_LIBRARY_RELEASE libovr64
66
PATHS ${OCULUS_LIBRARY_SEARCH_RELEASE_DIRS})
68
# Search for libraries files (debug mode)
69
FIND_LIBRARY(OCULUS_LIBRARY_DEBUG libovr64d
70
PATHS ${OCULUS_LIBRARY_SEARCH_DEBUG_DIRS})
72
# Configure libraries for debug/release
73
SET(OCULUS_INCLUDE_DIRS ${OCULUS_INCLUDE_DIR} CACHE PATH "Directory containing OCULUS header files")
74
SET(OCULUS_LIBRARY debug ${OCULUS_LIBRARY_DEBUG} optimized ${OCULUS_LIBRARY_RELEASE})
75
SET(OCULUS_LIBRARIES ${OCULUS_LIBRARY} CACHE STRING "OCULUS libraries files")
77
#IF(OCULUS_INCLUDE_DIR AND OCULUS_LIBRARY)
78
SET(OCULUS_FOUND TRUE)
81
# Hide those variables in GUI
82
SET(OCULUS_INCLUDE_DIR ${OCULUS_INCLUDE_DIR} CACHE INTERNAL "")
83
SET(OCULUS_LIBRARY_RELEASE ${OCULUS_LIBRARY_RELEASE} CACHE INTERNAL "")
84
SET(OCULUS_LIBRARY_DEBUG ${OCULUS_LIBRARY_DEBUG} CACHE INTERNAL "")
85
SET(OCULUS_LIBRARY ${OCULUS_LIBRARY} CACHE INTERNAL "")
89
IF(NOT OCULUS_FIND_QUIETLY)
90
MESSAGE(STATUS " libraries: ${OCULUS_LIBRARIES}")
91
MESSAGE(STATUS " includes: ${OCULUS_INCLUDE_DIRS}")
94
IF(NOT OCULUS_LIBRARIES)
95
MESSAGE(STATUS, "OCULUS library or one of it dependencies could not be found.")
97
IF(NOT OCULUS_INCLUDE_DIRS)
98
MESSAGE(STATUS "OCULUS include files could not be found.")