khanat-opennel-code/code/CMakeModules/FindLibOVR.cmake

73 lines
1.6 KiB
CMake
Raw Permalink Normal View History

# - Locate LibOVR library
# This module defines
# LIBOVR_LIBRARIES, the libraries to link against
# LIBOVR_FOUND, if false, do not try to link to LIBOVR
# LIBOVR_INCLUDE_DIR, where to find headers.
IF(LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIR)
# in cache already
SET(LIBOVR_FIND_QUIETLY TRUE)
2016-10-27 08:54:09 +00:00
ENDIF()
FIND_PATH(LIBOVR_INCLUDE_DIR
2016-10-31 18:00:19 +00:00
NAMES
OVR.h OVR_CAPI.h
PATHS
$ENV{LIBOVR_DIR}/Include
/usr/local/include
/usr/include
/sw/include
/opt/local/include
/opt/csw/include
/opt/include
)
IF(UNIX)
IF(TARGET_X64)
SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/Linux/Release/x86_64")
2016-10-27 08:54:09 +00:00
ELSE()
SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/Linux/Release/i386")
2016-10-27 08:54:09 +00:00
ENDIF()
ELSEIF(APPLE)
SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/MacOS/Release")
ELSEIF(WIN32)
IF(TARGET_X64)
SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/x64")
2016-10-27 08:54:09 +00:00
ELSE()
SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/Win32")
2016-10-27 08:54:09 +00:00
ENDIF()
ENDIF()
FIND_LIBRARY(LIBOVR_LIBRARY
2015-02-24 16:17:45 +00:00
NAMES ovr libovr
PATHS
$ENV{LIBOVR_DIR}/${LIBOVR_LIBRARY_BUILD_PATH}
/usr/local/lib
/usr/lib
/usr/local/X11R6/lib
/usr/X11R6/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
IF(LIBOVR_LIBRARY AND LIBOVR_INCLUDE_DIR)
IF(NOT LIBOVR_FIND_QUIETLY)
MESSAGE(STATUS "Found LibOVR: ${LIBOVR_LIBRARY}")
2016-10-27 08:54:09 +00:00
ENDIF()
SET(LIBOVR_FOUND "YES")
SET(LIBOVR_DEFINITIONS "-DHAVE_LIBOVR")
SET(NL_STEREO_AVAILABLE ON)
IF(UNIX)
SET(LIBOVR_LIBRARIES ${LIBOVR_LIBRARY} X11 Xinerama udev pthread)
2016-10-27 08:54:09 +00:00
ELSE()
SET(LIBOVR_LIBRARIES ${LIBOVR_LIBRARY})
2016-10-27 08:54:09 +00:00
ENDIF()
ELSE()
IF(NOT LIBOVR_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find LibOVR!")
2016-10-27 08:54:09 +00:00
ENDIF()
ENDIF()