-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFindVorbis.cmake
More file actions
103 lines (96 loc) · 2.54 KB
/
FindVorbis.cmake
File metadata and controls
103 lines (96 loc) · 2.54 KB
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
# - Locate Vorbis
# This module defines
# VORBIS_LIBRARY
# VORBIS_FOUND, if false, do not try to link to Vorbis
# VORBIS_INCLUDE_DIR, where to find the headers
#
# Created by Christian P. V. Christoffersen (cpvc). This was
# influenced by the FindOpenAL.cmake module for the unix version
# of this file. Jakob Juhl has fixed the file for Windows systems.
FIND_PATH(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h
$ENV{VORBIS_DIR}/include
/usr/local/include/vorbis
/usr/local/include
/usr/include/vorbis
/usr/include
/sw/include/vorbis
/sw/include
/opt/local/include/vorbis # DarwinPorts
/opt/local/include
/opt/csw/include
/opt/include
${OE_LIB_DIR}/vorbis/include
)
SET(VORBISLIB "vorbis")
SET(VORBISFILELIB "vorbisfile")
SET(OGGLIB "ogg")
#STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "debug" ISDEBUGENABLED)
#IF(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake)")
# IF(ISDEBUGENABLED)
# SET(VORBISLIB "vorbis_static_d")
# SET(VORBISFILELIB "vorbisfile_static_d")
# SET(OGGLIB "ogg_static_d")
# ELSE(ISDEBUGENABLED)
# SET(VORBISLIB "vorbis_static")
# SET(VORBISFILELIB "vorbisfile_static")
# SET(OGGLIB "ogg_static")
# ENDIF(ISDEBUGENABLED)
#ENDIF(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake)")
FIND_LIBRARY(VORBISFILE_LIBRARY
${VORBISFILELIB}
PATH
${OE_LIB_DIR}/vorbis/lib
$ENV{VORBIS_DIR}/lib
/usr/local/lib/vorbis
/usr/local/lib
/usr/lib/vorbis
/usr/lib
/sw/lib/vorbis
/sw/lib
/opt/local/lib/vorbis # DarwinPorts
/opt/local/lib
/opt/csw/lib
/opt/lib
)
FIND_LIBRARY(OGG_LIBRARY
${OGGLIB}
PATH
${OE_LIB_DIR}/vorbis/lib
$ENV{VORBIS_DIR}/lib
/usr/local/lib/vorbis
/usr/local/lib
/usr/lib/vorbis
/usr/lib
/sw/lib/vorbis
/sw/lib
/opt/local/lib/vorbis # DarwinPorts
/opt/local/lib
/opt/csw/lib
/opt/lib
)
FIND_LIBRARY(VORBIS_LIBRARY
${VORBISLIB}
PATH
${OE_LIB_DIR}/vorbis/lib
$ENV{VORBIS_DIR}/lib
/usr/local/lib/vorbis
/usr/local/lib
/usr/lib/vorbis
/usr/lib
/sw/lib/vorbis
/sw/lib
/opt/local/lib/vorbis # DarwinPorts
/opt/local/lib
/opt/csw/lib
/opt/lib
)
# Copy the results to the output variables.
IF(VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND OGG_LIBRARY)
SET(VORBIS_FOUND 1)
SET(VORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
SET(VORBIS_INCLUDE_DIR ${VORBIS_INCLUDE_DIR})
ELSE(VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND OGG_LIBRARY)
SET(VORBIS_FOUND 0)
SET(VORBIS_LIBRARIES)
SET(VORBIS_INCLUDE_DIR)
ENDIF(VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND OGG_LIBRARY)