forked from rpavlik/cmake-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindPerformer.cmake
153 lines (143 loc) · 3.32 KB
/
FindPerformer.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# - try to find the OpenGL Performer library
#
# Users may optionally supply:
# PERFORMER_ROOT_DIR - a prefix to start searching.
#
# Cache Variables: (probably not for direct use in your scripts)
# PERFORMER_INCLUDE_DIR
# PERFORMER_LIBRARY
# PERFORMER_PFUI_LIBRARY - doesn't get included in PERFORMER_LIBRARIES
# PERFORMER_PFDU_UTIL_LIBRARY - doesn't get included in PERFORMER_LIBRARIES
# PERFORMER_PFV_LIBRARY - doesn't get included in PERFORMER_LIBRARIES
#
# Non-cache variables you might use in your CMakeLists.txt:
# PERFORMER_FOUND
# PERFORMER_INCLUDE_DIRS
# PERFORMER_LIBRARIES
# PERFORMER_RUNTIME_LIBRARY_DIRS
#
# Requires these CMake modules:
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
#
# Original Author:
# 2012 Ryan Pavlik <[email protected]> <[email protected]>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
set(PERFORMER_ROOT_DIR
"${PERFORMER_ROOT_DIR}"
CACHE
PATH
"Path to search for OpenGL Performer library")
find_path(PERFORMER_INCLUDE_DIR
NAMES
pf.h
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
include
include/Performer
Performer
PATHS
$ENV{PFROOT})
mark_as_advanced(PERFORMER_INCLUDE_DIR)
if(WIN32)
set(_pf_libnameprefix lib)
find_library(PERFORMER_PFDU_UTIL_LIBRARY
NAMES
libpfdu-util
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
else()
set(_pf_libnameprefix)
find_library(PERFORMER_PFDU_LIBRARY
NAMES
pfdu
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
find_library(PERFORMER_PFUTIL_LIBRARY
NAMES
pfutil
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
if(PERFORMER_PFDU_LIBRARY AND PERFORMER_PFUTIL_LIBRARY)
set(PERFORMER_PFDU_UTIL_LIBRARY
${PERFORMER_PFDU_LIBRARY}
${PERFORMER_PFUTIL_LIBRARY})
endif()
endif()
find_library(PERFORMER_LIBRARY
NAMES
${_pf_libnameprefix}pf
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
find_library(PERFORMER_PFUI_LIBRARY
NAMES
${_pf_libnameprefix}pfui
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
find_library(PERFORMER_PFV_LIBRARY
NAMES
${_pf_libnameprefix}pfv
HINTS
"${PERFORMER_ROOT_DIR}"
PATH_SUFFIXES
lib
PATHS
$ENV{PFROOT})
###
# Prereq: OpenGL
###
find_package(OpenGL QUIET)
# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Performer
DEFAULT_MSG
PERFORMER_LIBRARY
PERFORMER_PFUI_LIBRARY
PERFORMER_PFV_LIBRARY
PERFORMER_PFDU_UTIL_LIBRARY
PERFORMER_INCLUDE_DIR
OPENGL_FOUND)
if(PERFORMER_FOUND)
set(PERFORMER_INCLUDE_DIRS
"${OPENGL_INCLUDE_DIR}"
"${PERFORMER_INCLUDE_DIR}")
if(PERFORMER_INCLUDE_DIR MATCHES ".*Performer.*")
list(APPEND PERFORMER_INCLUDE_DIRS "${PERFORMER_INCLUDE_DIR}/..")
endif()
set(PERFORMER_LIBRARIES "${OPENGL_LIBRARY}" "${PERFORMER_LIBRARY}")
mark_as_advanced(PERFORMER_ROOT_DIR)
endif()
mark_as_advanced(PERFORMER_LIBRARY
PERFORMER_PFUI_LIBRARY
PERFORMER_PFV_LIBRARY
PERFORMER_PFDU_LIBRARY
PERFORMER_PFUTIL_LIBRARY
PERFORMER_PFDU_UTIL_LIBRARY
PERFORMER_INCLUDE_DIR)