Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/archive/tutorialHS08/cmake/FindOggVorbis.cmake @ 10135

Last change on this file since 10135 was 1776, checked in by landauf, 16 years ago

Many changes in almost all FindXYZ.cmake files. They now throw errors if something wasn't found.

  • Property svn:eol-style set to native
File size: 4.1 KB
Line 
1# Several changes and additions by Fabian 'x3n' Landau
2#                 > www.orxonox.net <
3
4IF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
5  SET(OGG_FIND_QUIETLY TRUE)
6ENDIF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
7
8IF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISENC_LIBRARY AND VORBISFILE_LIBRARY)
9  SET(VORBIS_FIND_QUIETLY TRUE)
10ENDIF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISENC_LIBRARY AND VORBISFILE_LIBRARY) 
11
12
13#SET(OGGVORBIS_LIBRARY_DIR "/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/lib")
14#SET(OGGVORBIS_LIBRARY "-L ${OGGVORBIS_LIBRARY_DIR} -lvorbisenc -lvorbisfile -logg -lvorbis ")
15#SET(OGGVORBIS_INCLUDE_DIR "/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/include")
16
17#
18# Includes
19#
20
21FIND_PATH(OGG_INCLUDE_DIR ogg/ogg.h
22  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/include               # Tardis specific hack
23  /usr/local/include
24  /usr/include
25  /sw/include
26  /opt/local/include
27  /opt/csw/include
28  /opt/csw/include
29  /opt/include
30  ../libs/libogg-1.1.3/include
31  )
32
33FIND_PATH(VORBIS_INCLUDE_DIR vorbis/codec.h
34  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/include               # Tardis specific hack
35  /usr/local/include
36  /usr/include
37  /sw/include
38  /opt/local/include
39  /opt/csw/include
40  /opt/csw/include
41  /opt/include
42  ../libs/libvorbis-1.2.0/include
43  )
44
45#
46# Libs
47#
48
49FIND_LIBRARY(OGG_LIBRARY
50  NAMES ogg
51  PATHS
52  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
53  /usr/local/lib
54  /usr/lib
55  /sw/lib
56  /opt/local/lib
57  /opt/csw/lib
58  /opt/lib
59  ../libs/libogg-1.1.3/src/.libs
60  )
61
62FIND_LIBRARY(VORBIS_LIBRARY
63  NAMES vorbis
64  PATHS
65  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
66  /usr/local/lib
67  /usr/lib
68  /sw/lib
69  /opt/local/lib
70  /opt/csw/lib
71  /opt/lib
72  ../libs/libvorbis-1.2.0/lib/.libs
73  )
74
75FIND_LIBRARY(VORBISENC_LIBRARY
76  NAMES vorbisenc
77  PATHS
78  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
79  /usr/local/lib
80  /usr/lib
81  /sw/lib
82  /opt/local/lib
83  /opt/csw/lib
84  /opt/lib
85  ../libs/libvorbis-1.2.0/lib/.libs
86  )
87
88FIND_LIBRARY(VORBISFILE_LIBRARY
89  NAMES vorbisfile
90  PATHS
91  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
92  /usr/local/lib
93  /usr/lib
94  /sw/lib
95  /opt/local/lib
96  /opt/csw/lib
97  /opt/lib
98  ../libs/libvorbis-1.2.0/lib/.libs
99  )
100
101SET (OGG_FOUND "NO")
102
103IF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
104  SET (OGG_FOUND "YES")
105  IF (NOT OGG_FIND_QUIETLY)
106    MESSAGE (STATUS "Ogg was found.")
107    IF (VERBOSE_FIND)
108      MESSAGE (STATUS "  include path: ${OGG_INCLUDE_DIR}")
109      MESSAGE (STATUS "  library path: ${OGG_LIBRARY}")
110      MESSAGE (STATUS "  libraries:    ogg")
111    ENDIF (VERBOSE_FIND)
112  ENDIF (NOT OGG_FIND_QUIETLY)
113ELSE (OGG_INCLUDE_DIR AND OGG_LIBRARY)
114  IF (NOT OGG_INCLUDE_DIR)
115    MESSAGE (SEND_ERROR "Ogg include path was not found.")
116  ENDIF (NOT OGG_INCLUDE_DIR)
117  IF (NOT OGG_LIBRARY)
118    MESSAGE (SEND_ERROR "Ogg library was not found.")
119  ENDIF (NOT OGG_LIBRARY)
120ENDIF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
121
122
123SET (VORBIS_FOUND "NO")
124
125IF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISENC_LIBRARY AND VORBISFILE_LIBRARY)
126  SET (VORBIS_FOUND "YES")
127  IF (NOT VORBIS_FIND_QUIETLY)
128    MESSAGE (STATUS "Vorbis was found.")
129    IF (VERBOSE_FIND)
130      MESSAGE (STATUS "  include path: ${VORBIS_INCLUDE_DIR}")
131      MESSAGE (STATUS "  library path: ${VORBIS_LIBRARY}")
132      MESSAGE (STATUS "  library path: ${VORBISENC_LIBRARY}")
133      MESSAGE (STATUS "  library path: ${VORBISFILE_LIBRARY}")
134      MESSAGE (STATUS "  libraries:    vorbis vorbisenc vorbisfile")
135    ENDIF (VERBOSE_FIND)
136  ENDIF (NOT VORBIS_FIND_QUIETLY)
137ELSE (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISENC_LIBRARY AND VORBISFILE_LIBRARY)
138  IF (NOT VORBIS_INCLUDE_DIR)
139    MESSAGE (SEND_ERROR "Vorbis include path was not found.")
140  ENDIF (NOT VORBIS_INCLUDE_DIR)
141  IF (NOT VORBIS_LIBRARY)
142    MESSAGE (SEND_ERROR "Vorbis library \"vorbis\" was not found.")
143  ENDIF (NOT VORBIS_LIBRARY)
144  IF (NOT VORBISENC_LIBRARY)
145    MESSAGE (SEND_ERROR "Vorbis library \"vorbisenc\" was not found.")
146  ENDIF (NOT VORBISENC_LIBRARY)
147  IF (NOT VORBISFILE_LIBRARY)
148    MESSAGE (SEND_ERROR "Vorbis library \"vorbisfile\" was not found.")
149  ENDIF (NOT VORBISFILE_LIBRARY)
150ENDIF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISENC_LIBRARY AND VORBISFILE_LIBRARY)
151
Note: See TracBrowser for help on using the repository browser.