cmake_modules/FindOggVorbis.cmake
changeset 2437 10e4b5fc0d93
parent 2400 2422ea85d100
child 2606 ed687a8d081f
equal deleted inserted replaced
2436:246ef6271470 2437:10e4b5fc0d93
    17 
    17 
    18 
    18 
    19 include (CheckLibraryExists)
    19 include (CheckLibraryExists)
    20 find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
    20 find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
    21 #  [koda] (for Hedgewars) added libraries with capital names for compatibility with Mac frameworks
    21 #  [koda] (for Hedgewars) added libraries with capital names for compatibility with Mac frameworks
       
    22 if(APPLE)
       
    23 set(CMAKE_FIND_FRAMEWORK "FIRST")
       
    24 endif(APPLE)
    22 find_library(OGG_LIBRARY NAMES ogg Ogg)
    25 find_library(OGG_LIBRARY NAMES ogg Ogg)
    23 find_library(VORBIS_LIBRARY NAMES vorbis Vorbis)
    26 find_library(VORBIS_LIBRARY NAMES vorbis Vorbis)
    24 find_library(VORBISFILE_LIBRARY NAMES vorbisfile Vorbis)
    27 find_library(VORBISFILE_LIBRARY NAMES vorbisfile Vorbis)
       
    28 
    25 if (OGG_LIBRARY AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)
    29 if (OGG_LIBRARY AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)
    26    set(OGGVORBIS_FOUND TRUE)
    30    set(OGGVORBIS_FOUND TRUE)
    27 #  [sommer] (for SuperTux) reversed order of libraries, so that cmake 2.4.5 for Windows generates an MSYS Makefile that will link correctly
    31 #  [sommer] (for SuperTux) reversed order of libraries, so that cmake 2.4.5 for Windows generates an MSYS Makefile that will link correctly
    28 #  set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
    32 #  set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
    29    set(OGGVORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
    33    set(OGGVORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
    35       set (OGGVORBIS_VERSION 2)
    39       set (OGGVORBIS_VERSION 2)
    36    else (HAVE_LIBVORBISENC2)
    40    else (HAVE_LIBVORBISENC2)
    37       set (OGGVORBIS_VERSION 1)
    41       set (OGGVORBIS_VERSION 1)
    38    endif (HAVE_LIBVORBISENC2)
    42    endif (HAVE_LIBVORBISENC2)
    39 else ()
    43 else ()
    40    set (OGGVORBIS_VERSION)
    44    set(OGGVORBIS_VERSION)
    41    set(OGGVORBIS_FOUND FALSE)
    45    set(OGGVORBIS_FOUND FALSE)
    42 endif ()
    46 endif ()
    43 if (OGGVORBIS_FOUND)
    47 if (OGGVORBIS_FOUND)
    44    if (NOT OggVorbis_FIND_QUIETLY)
    48    if (NOT OggVorbis_FIND_QUIETLY)
    45       message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
    49       message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")