Warning, /frameworks/kdelibs4support/cmake/modules/FindOggVorbis.cmake is written in an unsupported language. File is not indexed.

0001 # - Try to find the OggVorbis libraries
0002 # Once done this will define
0003 #
0004 #  OGGVORBIS_FOUND - system has OggVorbis
0005 #  OGGVORBIS_VERSION - set either to 1 or 2
0006 #  OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory
0007 #  OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis
0008 #  OGG_LIBRARY         - The Ogg library
0009 #  VORBIS_LIBRARY      - The Vorbis library
0010 #  VORBISFILE_LIBRARY  - The VorbisFile library
0011 #  VORBISENC_LIBRARY   - The VorbisEnc library
0012 
0013 # Copyright (c) 2006, Richard Laerkaeng, <richard@goteborg.utfors.se>
0014 #
0015 # Redistribution and use is allowed according to the terms of the BSD license.
0016 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
0017 
0018 
0019 include (CheckLibraryExists)
0020 
0021 find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
0022 find_path(OGG_INCLUDE_DIR ogg/ogg.h)
0023 
0024 find_library(OGG_LIBRARY NAMES ogg)
0025 find_library(VORBIS_LIBRARY NAMES vorbis)
0026 find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
0027 find_library(VORBISENC_LIBRARY NAMES vorbisenc)
0028 
0029 mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR
0030                  OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY)
0031 
0032 
0033 if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
0034 
0035    set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY})
0036 
0037    set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
0038    set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES})
0039    check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
0040    set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP})
0041 
0042    if (HAVE_LIBVORBISENC2)
0043       set (OGGVORBIS_VERSION 2)
0044    else (HAVE_LIBVORBISENC2)
0045       set (OGGVORBIS_VERSION 1)
0046    endif (HAVE_LIBVORBISENC2)
0047 
0048 endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
0049 
0050 
0051 include(FindPackageHandleStandardArgs)
0052 find_package_handle_standard_args(OggVorbis REQUIRED_VARS VORBIS_LIBRARY OGG_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY
0053                                                           VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR)
0054 
0055 #check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H)
0056 #check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG)
0057 #check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS)
0058 #check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE)
0059 #check_library_exists(vorbisenc vorbis_info_clear "" HAVE_LIBVORBISENC)
0060 #check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
0061 
0062 #if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
0063 #    message(STATUS "Ogg/Vorbis found")
0064 #    set (VORBIS_LIBS "-lvorbis -logg")
0065 #    set (VORBISFILE_LIBS "-lvorbisfile")
0066 #    set (VORBISENC_LIBS "-lvorbisenc")
0067 #    set (OGGVORBIS_FOUND TRUE)
0068 #    if (HAVE_LIBVORBISENC2)
0069 #        set (HAVE_VORBIS 2)
0070 #    else (HAVE_LIBVORBISENC2)
0071 #        set (HAVE_VORBIS 1)
0072 #    endif (HAVE_LIBVORBISENC2)
0073 #else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
0074 #    message(STATUS "Ogg/Vorbis not found")
0075 #endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
0076