2012-03-23 11:05:17 +01:00
|
|
|
# - Find vorbis
|
|
|
|
# Find the native vorbis includes and libraries
|
|
|
|
#
|
|
|
|
# VORBIS_INCLUDE_DIR - where to find vorbis.h, etc.
|
2012-03-25 21:07:34 +02:00
|
|
|
# OGG_INCLUDE_DIR - where to find ogg/ogg.h, etc.
|
2012-03-23 11:05:17 +01:00
|
|
|
# VORBIS_LIBRARIES - List of libraries when using vorbis(file).
|
|
|
|
# VORBIS_FOUND - True if vorbis found.
|
|
|
|
|
|
|
|
if(NOT GP2XWIZ)
|
|
|
|
if(VORBIS_INCLUDE_DIR)
|
|
|
|
# Already in cache, be silent
|
|
|
|
set(VORBIS_FIND_QUIETLY TRUE)
|
|
|
|
endif(VORBIS_INCLUDE_DIR)
|
|
|
|
find_path(OGG_INCLUDE_DIR ogg/ogg.h)
|
|
|
|
find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
|
|
|
|
# MSVC built ogg/vorbis may be named ogg_static and vorbis_static
|
|
|
|
find_library(OGG_LIBRARY NAMES ogg ogg_static)
|
|
|
|
find_library(VORBIS_LIBRARY NAMES vorbis vorbis_static)
|
|
|
|
find_library(VORBISFILE_LIBRARY NAMES vorbisfile vorbisfile_static)
|
|
|
|
# Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
|
|
|
|
# to TRUE if all listed variables are TRUE.
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-04-28 16:34:18 +02:00
|
|
|
find_package_handle_standard_args(Vorbis DEFAULT_MSG
|
2012-03-23 11:05:17 +01:00
|
|
|
OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR
|
|
|
|
OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
|
|
|
|
else(NOT GP2XWIZ)
|
|
|
|
find_path(VORBIS_INCLUDE_DIR tremor/ivorbisfile.h)
|
|
|
|
find_library(VORBIS_LIBRARY NAMES vorbis_dec)
|
2020-04-28 16:34:18 +02:00
|
|
|
find_package_handle_standard_args(Vorbis DEFAULT_MSG
|
2012-03-23 11:05:17 +01:00
|
|
|
VORBIS_INCLUDE_DIR VORBIS_LIBRARY)
|
|
|
|
endif(NOT GP2XWIZ)
|
2021-12-02 00:54:12 +01:00
|
|
|
|
2012-03-23 11:05:17 +01:00
|
|
|
if(VORBIS_FOUND)
|
2021-12-02 00:54:12 +01:00
|
|
|
if(NOT GP2XWIZ)
|
|
|
|
set(VORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY}
|
|
|
|
${OGG_LIBRARY})
|
|
|
|
else(NOT GP2XWIZ)
|
|
|
|
set(VORBIS_LIBRARIES ${VORBIS_LIBRARY})
|
|
|
|
endif(NOT GP2XWIZ)
|
2012-03-23 11:05:17 +01:00
|
|
|
else(VORBIS_FOUND)
|
2021-12-02 00:54:12 +01:00
|
|
|
set(VORBIS_LIBRARIES)
|
2012-03-23 11:05:17 +01:00
|
|
|
endif(VORBIS_FOUND)
|
|
|
|
|
|
|
|
mark_as_advanced(OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
|