forked from Eyescale/CMake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindTuvok.cmake
66 lines (58 loc) · 1.92 KB
/
FindTuvok.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright (c) 2013 Ahmet Bilgili <[email protected]>
# Modified from: FindSAGE.cmake
# - Try to find the TUVOK library
# Once done this will define
#
# TUVOK_ROOT - Set this variable to the root installation of CAIRO
#
# Read-Only variables:
# TUVOK_FOUND - system has the TUVOK library
# TUVOK_INCLUDE_DIR - the TUVOK include directory
# TUVOK_LIBRARY - The libraries needed to use SAGE
# (TODO) TUVOK_VERSION - This is set to $major.$minor.$revision (eg. 0.9.8)
include(FindPackageHandleStandardArgs)
if(TUVOK_FIND_REQUIRED)
set(_TUVOK_required REQUIRED)
set(_TUVOK_output 1)
else()
if(NOT TUVOK_FIND_QUIETLY)
set(_TUVOK_output 1)
endif()
endif()
if(TUVOK_FIND_QUIETLY)
set(_TUVOK_quiet QUIET)
endif()
find_path(_TUVOK_INCLUDE_DIR StdTuvokDefines.h
HINTS ${PROJECT_SOURCE_DIR}/../../.. $ENV{TUVOK_ROOT} ${TUVOK_ROOT}
PATH_SUFFIXES include/Tuvok
PATHS /usr/local /usr /opt )
if(_TUVOK_INCLUDE_DIR AND EXISTS "${_TUVOK_INCLUDE_DIR}/StdTuvokDefines.h")
set(_TUVOK_FAIL FALSE)
else()
set(_TUVOK_FAIL TRUE)
if(_TUVOK_output)
message(STATUS "Can't find Tuvok header file StdTuvokDefines.h.")
endif()
endif()
find_library(TUVOK_LIBRARY Tuvok
HINTS ${PROJECT_SOURCE_DIR}/../../.. $ENV{TUVOK_ROOT} ${TUVOK_ROOT}
PATH_SUFFIXES lib lib64
PATHS /usr/local /usr /usr/local /opt /opt/local)
if(TUVOK_FIND_REQUIRED)
if(TUVOK_LIBRARY MATCHES "TUVOK_LIBRARY-NOTFOUND")
message(FATAL_ERROR "Missing the Tuvok library.\n"
"Consider using CMAKE_PREFIX_PATH or the TUVOK_ROOT environment variable. "
"See the ${CMAKE_CURRENT_LIST_FILE} for more details.")
endif()
endif()
find_package_handle_standard_args(TUVOK DEFAULT_MSG TUVOK_LIBRARY _TUVOK_INCLUDE_DIR)
if(_TUVOK_FAIL)
# Zero out everything, we didn't meet version requirements
set(TUVOK_FOUND FALSE)
set(TUVOK_LIBRARY)
set(_TUVOK_INCLUDE_DIR)
set(TUVOK_INCLUDE_DIR)
set(TUVOK_LIBRARY)
else()
set(TUVOK_INCLUDE_DIR ${_TUVOK_INCLUDE_DIR})
endif()