cmake_modules/FindOggVorbis.cmake
changeset 2336 66c751f7a28e
parent 2214 eacb5b19d587
child 2395 d01d3bf3e1de
equal deleted inserted replaced
2335:0a61a3c2efc4 2336:66c751f7a28e
    18 include (CheckLibraryExists)
    18 include (CheckLibraryExists)
    19 find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
    19 find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
    20 find_library(OGG_LIBRARY NAMES ogg)
    20 find_library(OGG_LIBRARY NAMES ogg)
    21 find_library(VORBIS_LIBRARY NAMES vorbis)
    21 find_library(VORBIS_LIBRARY NAMES vorbis)
    22 find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
    22 find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
    23 if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)
    23 if (OGG_LIBRARY AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)
    24    set(OGGVORBIS_FOUND TRUE)
    24    set(OGGVORBIS_FOUND TRUE)
    25 #  [sommer] (for SuperTux) reversed order of libraries, so that cmake 2.4.5 for Windows generates an MSYS Makefile that will link correctly
    25 #  [sommer] (for SuperTux) reversed order of libraries, so that cmake 2.4.5 for Windows generates an MSYS Makefile that will link correctly
    26 #  set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
    26 #  set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
    27    set(OGGVORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
    27    set(OGGVORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
    28    set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
    28    set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
    32    if (HAVE_LIBVORBISENC2)
    32    if (HAVE_LIBVORBISENC2)
    33       set (OGGVORBIS_VERSION 2)
    33       set (OGGVORBIS_VERSION 2)
    34    else (HAVE_LIBVORBISENC2)
    34    else (HAVE_LIBVORBISENC2)
    35       set (OGGVORBIS_VERSION 1)
    35       set (OGGVORBIS_VERSION 1)
    36    endif (HAVE_LIBVORBISENC2)
    36    endif (HAVE_LIBVORBISENC2)
    37 else (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)
    37 else ()
    38    set (OGGVORBIS_VERSION)
    38    set (OGGVORBIS_VERSION)
    39    set(OGGVORBIS_FOUND FALSE)
    39    set(OGGVORBIS_FOUND FALSE)
    40 endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)
    40 endif ()
    41 if (OGGVORBIS_FOUND)
    41 if (OGGVORBIS_FOUND)
    42    if (NOT OggVorbis_FIND_QUIETLY)
    42    if (NOT OggVorbis_FIND_QUIETLY)
    43       message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
    43       message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
    44    endif (NOT OggVorbis_FIND_QUIETLY)
    44    endif (NOT OggVorbis_FIND_QUIETLY)
    45 else (OGGVORBIS_FOUND)
    45 else (OGGVORBIS_FOUND)