cmake_modules/FindOggVorbis.cmake
author nemo
Sat, 29 Nov 2014 14:00:40 -0500
changeset 10578 814acf1511be
parent 8667 f93cc19d8b98
permissions -rw-r--r--
duplicate the ammoshove block into the falling fire area - this will make falling flames take out hogs in saucers, on rope, etc. no more dodging your own napalm strike by taking to the skies...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2214
eacb5b19d587 -new FindOggVorbis, should work everywhere now
koda
parents: 2211
diff changeset
     1
# - Try to find the OggVorbis libraries
eacb5b19d587 -new FindOggVorbis, should work everywhere now
koda
parents: 2211
diff changeset
     2
# Once done this will define
eacb5b19d587 -new FindOggVorbis, should work everywhere now
koda
parents: 2211
diff changeset
     3
#
8660
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
     4
#  OGGVORBIS_FOUND       - system has both Ogg and Vorbis
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
     5
#  OGGVORBIS_VERSION     - set either to 1 or 2
2214
eacb5b19d587 -new FindOggVorbis, should work everywhere now
koda
parents: 2211
diff changeset
     6
#  OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory
8667
f93cc19d8b98 comas and capitals
koda
parents: 8660
diff changeset
     7
#  OGGVORBIS_LIBRARIES   - the libraries needed to use OggVorbis
8660
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
     8
#
8667
f93cc19d8b98 comas and capitals
koda
parents: 8660
diff changeset
     9
#  OGG_LIBRARY           - the Ogg library
f93cc19d8b98 comas and capitals
koda
parents: 8660
diff changeset
    10
#  OGG_INCLUDE_DIR       - the Ogg include directory
f93cc19d8b98 comas and capitals
koda
parents: 8660
diff changeset
    11
#  VORBIS_LIBRARY        - the Vorbis library
f93cc19d8b98 comas and capitals
koda
parents: 8660
diff changeset
    12
#  VORBIS_INCLUDE_DIR    - the Vorbis include directory
f93cc19d8b98 comas and capitals
koda
parents: 8660
diff changeset
    13
#  VORBISFILE_LIBRARY    - the VorbisFile library
8660
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    14
#
8667
f93cc19d8b98 comas and capitals
koda
parents: 8660
diff changeset
    15
# Copyright (c) 2006, Richard Laerkaeng <richard@goteborg.utfors.se>
f93cc19d8b98 comas and capitals
koda
parents: 8660
diff changeset
    16
# Copyright (c) 2013, Vittorio Giovara <vittorio.giovara@gmail.com>
2214
eacb5b19d587 -new FindOggVorbis, should work everywhere now
koda
parents: 2211
diff changeset
    17
#
eacb5b19d587 -new FindOggVorbis, should work everywhere now
koda
parents: 2211
diff changeset
    18
# Redistribution and use is allowed according to the terms of the BSD license.
eacb5b19d587 -new FindOggVorbis, should work everywhere now
koda
parents: 2211
diff changeset
    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
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    21
### sommer [SuperTux]
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    22
##  - Removed unused vorbisenc library
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    23
##  - reversed order of libraries, so that cmake 2.4.5 for Windows generates an MSYS Makefile that will link correctly
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    24
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    25
### koda [Hedgewars]
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    26
##  - split ogg and vorbis lookup
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    27
##  - special case for framework handling
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    28
##  - standard variables handling
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    29
2395
d01d3bf3e1de makes the updater optional at compile time
koda
parents: 2336
diff changeset
    30
2214
eacb5b19d587 -new FindOggVorbis, should work everywhere now
koda
parents: 2211
diff changeset
    31
include (CheckLibraryExists)
8660
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    32
include (FindPackageHandleStandardArgs)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    33
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    34
find_path(OGG_INCLUDE_DIR ogg.h PATH_SUFFIXES ogg)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    35
find_path(VORBIS_INCLUDE_DIR vorbisfile.h PATH_SUFFIXES vorbis)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    36
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    37
find_library(OGG_LIBRARY NAMES Ogg ogg)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    38
find_library(VORBIS_LIBRARY NAMES Vorbis vorbis)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    39
find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
2606
ed687a8d081f updated build files for macosx and optimization system
koda
parents: 2437
diff changeset
    40
8660
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    41
set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    42
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES})
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    43
check_library_exists(${VORBIS_LIBRARY} vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    44
set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP})
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    45
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    46
if(HAVE_LIBVORBISENC2)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    47
    set(OGGVORBIS_VERSION 2)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    48
else(HAVE_LIBVORBISENC2)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    49
    set(OGGVORBIS_VERSION 1)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    50
endif(HAVE_LIBVORBISENC2)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    51
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    52
if(${OGG_LIBRARY} MATCHES ".framework" AND ${VORBIS_LIBRARY} MATCHES ".framework")
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    53
    set(VORBISFILE_LIBRARY "") #vorbisfile will appear as NOTFOUND and discarded
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    54
    set(fphsa_vorbis_list VORBIS_LIBRARY)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    55
else()
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    56
    set(fphsa_vorbis_list VORBISFILE_LIBRARY VORBIS_LIBRARY)
5169
e353ca78d28b some comments and simplifications for cmake files
koda
parents: 2609
diff changeset
    57
endif()
2437
10e4b5fc0d93 fix sound by smaxx and other stuff by me
koda
parents: 2400
diff changeset
    58
8660
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    59
find_package_handle_standard_args(OggVorbis DEFAULT_MSG ${fphsa_vorbis_list} OGG_LIBRARY
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    60
                                                        OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    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
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    63
set(OGGVORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    64
set(OGGVORBIS_INCLUDE_DIR ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR})
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    65
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    66
mark_as_advanced(OGGVORBIS_VERSION OGGVORBIS_INCLUDE_DIR OGGVORBIS_LIBRARIES
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    67
                 OGG_LIBRARY OGG_INCLUDE_DIR VORBIS_LIBRARY VORBIS_INCLUDE_DIR VORBISFILE_LIBRARY)
6370e545fd5f rewritten FindOggVorbis.cmake
koda
parents: 5169
diff changeset
    68