cmake_modules/FindOggVorbis.cmake
changeset 2395 d01d3bf3e1de
parent 2336 66c751f7a28e
child 2400 2422ea85d100
equal deleted inserted replaced
2394:0f8de781fc34 2395:d01d3bf3e1de
    12 #  VORBISFILE_LIBRARY  - The VorbisFile library
    12 #  VORBISFILE_LIBRARY  - The VorbisFile library
    13 # Copyright (c) 2006, Richard Laerkaeng, <richard@goteborg.utfors.se>
    13 # Copyright (c) 2006, Richard Laerkaeng, <richard@goteborg.utfors.se>
    14 #
    14 #
    15 # Redistribution and use is allowed according to the terms of the BSD license.
    15 # Redistribution and use is allowed according to the terms of the BSD license.
    16 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
    16 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
       
    17 
    17 
    18 
    18 include (CheckLibraryExists)
    19 include (CheckLibraryExists)
    19 find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
    20 find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
    20 find_library(OGG_LIBRARY NAMES ogg)
    21 find_library(OGG_LIBRARY NAMES ogg)
    21 find_library(VORBIS_LIBRARY NAMES vorbis)
    22 find_library(VORBIS_LIBRARY NAMES vorbis)
    43       message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
    44       message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
    44    endif (NOT OggVorbis_FIND_QUIETLY)
    45    endif (NOT OggVorbis_FIND_QUIETLY)
    45 else (OGGVORBIS_FOUND)
    46 else (OGGVORBIS_FOUND)
    46    if (OggVorbis_FIND_REQUIRED)
    47    if (OggVorbis_FIND_REQUIRED)
    47       message(FATAL_ERROR "Could NOT find OggVorbis libraries")
    48       message(FATAL_ERROR "Could NOT find OggVorbis libraries")
    48    endif (OggVorbis_FIND_REQUIRED)
    49    else (OggVorbis_FIND_REQUIRED)
    49    if (NOT OggVorbis_FIND_QUIETLY)
    50       if (NOT OggVorbis_FIND_QUIETLY)
    50       message(STATUS "Could NOT find OggVorbis libraries")
    51          message(STATUS "Could NOT find OggVorbis libraries")
    51    endif (NOT OggVorbis_FIND_QUIETLY)
    52       endif (NOT OggVorbis_FIND_QUIETLY)
       
    53    endif(OggVorbis_FIND_REQUIRED)
    52 endif (OGGVORBIS_FOUND)
    54 endif (OGGVORBIS_FOUND)
    53 #check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H)
       
    54 #check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG)
       
    55 #check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS)
       
    56 #check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE)
       
    57 #check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
       
    58 #if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE)
       
    59 #    message(STATUS "Ogg/Vorbis found")
       
    60 #    set (VORBIS_LIBS "-lvorbis -logg")
       
    61 #    set (VORBISFILE_LIBS "-lvorbisfile")
       
    62 #    set (OGGVORBIS_FOUND TRUE)
       
    63 #    if (HAVE_LIBVORBISENC2)
       
    64 #        set (HAVE_VORBIS 2)
       
    65 #    else (HAVE_LIBVORBISENC2)
       
    66 #        set (HAVE_VORBIS 1)
       
    67 #    endif (HAVE_LIBVORBISENC2)
       
    68 #else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE)
       
    69 #    message(STATUS "Ogg/Vorbis not found")
       
    70 #endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE)
       
    71 
    55 
    72