FreeCAD

Форк
0
/
FindRift.cmake 
100 строк · 3.2 Кб
1
# Find OCULUS
2
#
3
# This module defines
4
#  OCULUS_FOUND
5
#  OCULUS_INCLUDE_DIRS
6
#  OCULUS_LIBRARIES
7
#
8
# Copyright (c) 2012 I-maginer
9
#
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
13
# version.
14
#
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.
18
#
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
23
#
24

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)
28
ENDIF()
29

30
# If OCULUS_ROOT was defined in the environment, use it.
31
if (NOT OCULUS_ROOT)
32
  if(NOT "$ENV{OCULUS_ROOT}" STREQUAL "")
33
    set(OCULUS_ROOT $ENV{OCULUS_ROOT})
34
  else()
35
    set(OCULUS_ROOT $ENV{SCOL_DEPENDENCIES_PATH}/oculus/LibOVR)
36
  endif()
37
endif()
38

39
# concat all the search paths
40
IF(OCULUS_ROOT)
41
	SET(OCULUS_INCLUDE_SEARCH_DIRS
42
	  ${OCULUS_INCLUDE_SEARCH_DIRS}
43
	  ${OCULUS_ROOT}/include
44
  )
45
  SET(OCULUS_LIBRARY_SEARCH_RELEASE_DIRS
46
    ${OCULUS_LIBRARY_SEARCH_DIRS}
47
    ${OCULUS_ROOT}/Lib/x64/VS2012
48
  )
49
  SET(OCULUS_LIBRARY_SEARCH_DEBUG_DIRS
50
    ${OCULUS_LIBRARY_SEARCH_DIRS}
51
    ${OCULUS_ROOT}/Lib/x64/VS2012
52
  )
53
ENDIF()
54

55
# log message
56
IF (NOT OCULUS_FIND_QUIETLY)
57
	MESSAGE(STATUS "Checking for OCULUS library")
58
ENDIF()
59

60
# Search for header files
61
FIND_PATH(OCULUS_INCLUDE_DIR OVR.h
62
  PATHS ${OCULUS_INCLUDE_SEARCH_DIRS})
63

64
# Search for libraries files (release mode)
65
FIND_LIBRARY(OCULUS_LIBRARY_RELEASE libovr64
66
  PATHS ${OCULUS_LIBRARY_SEARCH_RELEASE_DIRS})
67

68
# Search for libraries files (debug mode)
69
FIND_LIBRARY(OCULUS_LIBRARY_DEBUG libovr64d
70
  PATHS ${OCULUS_LIBRARY_SEARCH_DEBUG_DIRS})
71

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")
76

77
#IF(OCULUS_INCLUDE_DIR AND OCULUS_LIBRARY)
78
	SET(OCULUS_FOUND TRUE)
79
#ENDIF()
80

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 "")
86

87
# log find result
88
IF(OCULUS_FOUND)
89
	IF(NOT OCULUS_FIND_QUIETLY)
90
		MESSAGE(STATUS "  libraries: ${OCULUS_LIBRARIES}")
91
		MESSAGE(STATUS "  includes: ${OCULUS_INCLUDE_DIRS}")
92
	ENDIF()
93
ELSE(OCULUS_FOUND)
94
	IF(NOT OCULUS_LIBRARIES)
95
		MESSAGE(STATUS, "OCULUS library or one of it dependencies could not be found.")
96
	ENDIF()
97
	IF(NOT OCULUS_INCLUDE_DIRS)
98
		MESSAGE(STATUS "OCULUS include files could not be found.")
99
	ENDIF()
100
ENDIF(OCULUS_FOUND)

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.