forked from cginternals/globjects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glow-config.cmake
125 lines (108 loc) · 3.03 KB
/
glow-config.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
# GLOW_FOUND
# GLOW_INCLUDE_DIR
# GLOW_LIBRARY
# GLOW_UTILS_LIBRARY
# GLOW_WINDOW_LIBRARY
find_path(GLOW_INCLUDE_DIR glow/glow.h
$ENV{GLOW_DIR}/include
${GLOW_DIR}/include
$ENV{PROGRAMFILES}/GLOW/include
/usr/include
/usr/local/include
/sw/include
/opt/local/include
DOC "The directory where glow/glow.h resides")
set(LIB_PATHS
$ENV{GLOW_DIR}/lib
${GLOW_DIR}/lib
/usr/lib
/usr/local/lib
/sw/lib
/opt/local/lib
/usr/lib64
/usr/local/lib64
/sw/lib64
/opt/local/lib64
)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
find_library(GLOW_LIBRARY
NAMES glow
PATHS ${LIB_PATHS}
DOC "The glow library")
find_library(GLOW_UTILS_LIBRARY
NAMES glowutils
PATHS ${LIB_PATHS}
DOC "The glowutils library")
find_library(GLOW_WINDOW_LIBRARY
NAMES glowwindow
PATHS ${LIB_PATHS}
DOC "The glowwindow library")
if (NOT GLOW_LIBRARY)
message(STATUS "glow release library requested but not found, search for debug version.")
find_library(GLOW_LIBRARY
NAMES glowd
PATHS ${LIB_PATHS}
DOC "The glow debug library")
endif()
if (NOT GLOW_UTILS_LIBRARY)
message(STATUS "glowutils release library requested but not found, search for debug version.")
find_library(GLOW_UTILS_LIBRARY
NAMES glowutilsd
PATHS ${LIB_PATHS}
DOC "The glowutils debug library")
endif()
if (NOT GLOW_WINDOW_LIBRARY)
message(STATUS "glowwindow release library requested but not found, search for debug version.")
find_library(GLOW_WINDOW_LIBRARY
NAMES glowwindowd
PATHS ${LIB_PATHS}
DOC "The glowwindow debug library")
endif()
else()
find_library(GLOW_LIBRARY
NAMES glowd
PATHS ${LIB_PATHS}
DOC "The glow debug library")
find_library(GLOW_UTILS_LIBRARY
NAMES glowutilsd
PATHS ${LIB_PATHS}
DOC "The glowutils debug library")
find_library(GLOW_WINDOW_LIBRARY
NAMES glowwindowd
PATHS ${LIB_PATHS}
DOC "The glowwindow debug library")
if (GLOW_LIBRARY)
message(STATUS "Using debug version of glow")
else()
message(STATUS "glow debug library requested but not found, search for release version.")
find_library(GLOW_LIBRARY
NAMES glow
PATHS ${LIB_PATHS}
DOC "The glow library")
endif()
if (GLOW_UTILS_LIBRARY)
message(STATUS "Using debug version of glowutils")
else()
message(STATUS "glowutils debug library requested but not found, search for release version.")
find_library(GLOW_UTILS_LIBRARY
NAMES glowutils
PATHS ${LIB_PATHS}
DOC "The glowutils library")
endif()
if (GLOW_WINDOW_LIBRARY)
message(STATUS "Using debug version of glowwindow")
else()
message(STATUS "glowwindow debug library requested but not found, search for release version.")
find_library(GLOW_WINDOW_LIBRARY
NAMES glowwindow
PATHS ${LIB_PATHS}
DOC "The glowwindow library")
endif()
endif()
if(GLOW_INCLUDE_DIR AND GLOW_LIBRARY)
set(GLOW_FOUND 1 CACHE STRING "Set to 1 if glow is found, 0 otherwise")
else()
set(GLOW_FOUND 0 CACHE STRING "Set to 1 if glow is found, 0 otherwise")
message(WARNING "Note: an envvar like GLOW_DIR assists this script to locate glow.")
endif()
mark_as_advanced(GLOW_FOUND)