author | Periklis Ntanasis <pntanasis@gmail.com> |
Sat, 21 Dec 2013 02:18:40 +0200 | |
changeset 9810 | 54c0fdec4600 |
parent 8667 | f93cc19d8b98 |
permissions | -rw-r--r-- |
2214 | 1 |
# - Try to find the OggVorbis libraries |
2 |
# Once done this will define |
|
3 |
# |
|
8660 | 4 |
# OGGVORBIS_FOUND - system has both Ogg and Vorbis |
5 |
# OGGVORBIS_VERSION - set either to 1 or 2 |
|
2214 | 6 |
# OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory |
8667 | 7 |
# OGGVORBIS_LIBRARIES - the libraries needed to use OggVorbis |
8660 | 8 |
# |
8667 | 9 |
# OGG_LIBRARY - the Ogg library |
10 |
# OGG_INCLUDE_DIR - the Ogg include directory |
|
11 |
# VORBIS_LIBRARY - the Vorbis library |
|
12 |
# VORBIS_INCLUDE_DIR - the Vorbis include directory |
|
13 |
# VORBISFILE_LIBRARY - the VorbisFile library |
|
8660 | 14 |
# |
8667 | 15 |
# Copyright (c) 2006, Richard Laerkaeng <richard@goteborg.utfors.se> |
16 |
# Copyright (c) 2013, Vittorio Giovara <vittorio.giovara@gmail.com> |
|
2214 | 17 |
# |
18 |
# Redistribution and use is allowed according to the terms of the BSD license. |
|
19 |
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. |
|
2194
1597710c6118
koda adds threading for fadein/out. Untested under windows, but works beautifully under Linux (and presumably OSX, right koda?)
nemo
parents:
diff
changeset
|
20 |
|
8660 | 21 |
### sommer [SuperTux] |
22 |
## - Removed unused vorbisenc library |
|
23 |
## - reversed order of libraries, so that cmake 2.4.5 for Windows generates an MSYS Makefile that will link correctly |
|
24 |
||
25 |
### koda [Hedgewars] |
|
26 |
## - split ogg and vorbis lookup |
|
27 |
## - special case for framework handling |
|
28 |
## - standard variables handling |
|
29 |
||
2395 | 30 |
|
2214 | 31 |
include (CheckLibraryExists) |
8660 | 32 |
include (FindPackageHandleStandardArgs) |
33 |
||
34 |
find_path(OGG_INCLUDE_DIR ogg.h PATH_SUFFIXES ogg) |
|
35 |
find_path(VORBIS_INCLUDE_DIR vorbisfile.h PATH_SUFFIXES vorbis) |
|
36 |
||
37 |
find_library(OGG_LIBRARY NAMES Ogg ogg) |
|
38 |
find_library(VORBIS_LIBRARY NAMES Vorbis vorbis) |
|
39 |
find_library(VORBISFILE_LIBRARY NAMES vorbisfile) |
|
2606
ed687a8d081f
updated build files for macosx and optimization system
koda
parents:
2437
diff
changeset
|
40 |
|
8660 | 41 |
set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES}) |
42 |
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES}) |
|
43 |
check_library_exists(${VORBIS_LIBRARY} vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2) |
|
44 |
set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP}) |
|
45 |
||
46 |
if(HAVE_LIBVORBISENC2) |
|
47 |
set(OGGVORBIS_VERSION 2) |
|
48 |
else(HAVE_LIBVORBISENC2) |
|
49 |
set(OGGVORBIS_VERSION 1) |
|
50 |
endif(HAVE_LIBVORBISENC2) |
|
51 |
||
52 |
if(${OGG_LIBRARY} MATCHES ".framework" AND ${VORBIS_LIBRARY} MATCHES ".framework") |
|
53 |
set(VORBISFILE_LIBRARY "") #vorbisfile will appear as NOTFOUND and discarded |
|
54 |
set(fphsa_vorbis_list VORBIS_LIBRARY) |
|
55 |
else() |
|
56 |
set(fphsa_vorbis_list VORBISFILE_LIBRARY VORBIS_LIBRARY) |
|
5169 | 57 |
endif() |
2437 | 58 |
|
8660 | 59 |
find_package_handle_standard_args(OggVorbis DEFAULT_MSG ${fphsa_vorbis_list} OGG_LIBRARY |
60 |
OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR) |
|
61 |
unset(fphsa_vorbis_list) |
|
2194
1597710c6118
koda adds threading for fadein/out. Untested under windows, but works beautifully under Linux (and presumably OSX, right koda?)
nemo
parents:
diff
changeset
|
62 |
|
8660 | 63 |
set(OGGVORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY}) |
64 |
set(OGGVORBIS_INCLUDE_DIR ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR}) |
|
65 |
||
66 |
mark_as_advanced(OGGVORBIS_VERSION OGGVORBIS_INCLUDE_DIR OGGVORBIS_LIBRARIES |
|
67 |
OGG_LIBRARY OGG_INCLUDE_DIR VORBIS_LIBRARY VORBIS_INCLUDE_DIR VORBISFILE_LIBRARY) |
|
68 |