Opus file support
Ogg: Introduce new functions ogg_sync_fseek(), ogg_ftell(), ogg_next_page(),
ogg_stream_next_page(), ogg_sync_last_page_before(), and
ogg_stream_unpack_page(). Use ogg_sync_* for ogg_read_first_page(). Bump libogg
version requirement from 1.1.3 to 1.3.0 as LibOgg 1.3.0 is required for
ogg_stream_pageout_fill() and ogg_stream_flush_fill().
Opus: Add opus support. Document added commands
SFC_(GET|SET)_ORIGINAL_SAMPLERATE. Added or extended tests ogg_opus_test,
compression_size_test, floating_point_test, lossy_comp_test, string_test,
external_libs_test. Change Opus to non-experimental.
2018-07-09 21:37:06 +00:00
|
|
|
# - Find opus
|
|
|
|
# Find the native opus includes and libraries
|
|
|
|
#
|
|
|
|
# OPUS_INCLUDE_DIRS - where to find opus.h, etc.
|
|
|
|
# OPUS_LIBRARIES - List of libraries when using opus.
|
|
|
|
# OPUS_FOUND - True if Opus found.
|
|
|
|
|
|
|
|
if (OPUS_INCLUDE_DIR)
|
|
|
|
# Already in cache, be silent
|
|
|
|
set(OPUS_FIND_QUIETLY TRUE)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
find_package (Ogg QUIET)
|
|
|
|
|
|
|
|
find_package (PkgConfig QUIET)
|
|
|
|
pkg_check_modules(PC_OPUS QUIET opus>=1.1)
|
|
|
|
|
|
|
|
set (OPUS_VERSION ${PC_OPUS_VERSION})
|
|
|
|
|
|
|
|
find_path (OPUS_INCLUDE_DIR opus/opus.h
|
|
|
|
HINTS
|
|
|
|
${PC_OPUS_INCLUDEDIR}
|
|
|
|
${PC_OPUS_INCLUDE_DIRS}
|
|
|
|
${OPUS_ROOT}
|
|
|
|
)
|
|
|
|
|
|
|
|
# MSVC built opus may be named opus_static.
|
|
|
|
# The provided project files name the library with the lib prefix.
|
|
|
|
|
|
|
|
find_library (OPUS_LIBRARY
|
|
|
|
NAMES
|
|
|
|
opus
|
|
|
|
opus_static
|
|
|
|
libopus
|
|
|
|
libopus_static
|
|
|
|
HINTS
|
|
|
|
${PC_OPUS_LIBDIR}
|
|
|
|
${PC_OPUS_LIBRARY_DIRS}
|
|
|
|
${OPUS_ROOT}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Handle the QUIETLY and REQUIRED arguments and set OPUS_FOUND
|
|
|
|
# to TRUE if all listed variables are TRUE.
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args (Opus
|
|
|
|
REQUIRED_VARS
|
|
|
|
OPUS_LIBRARY
|
|
|
|
OPUS_INCLUDE_DIR
|
|
|
|
OGG_FOUND
|
|
|
|
VERSION_VAR
|
|
|
|
OPUS_VERSION
|
|
|
|
)
|
|
|
|
|
|
|
|
if (OPUS_FOUND)
|
|
|
|
set (OPUS_LIBRARIES ${OPUS_LIBRARY})
|
|
|
|
set (OPUS_INCLUDE_DIRS ${OPUS_INCLUDE_DIR})
|
|
|
|
|
2020-03-08 05:28:46 +00:00
|
|
|
if (NOT TARGET Opus::opus)
|
|
|
|
add_library (Opus::opus UNKNOWN IMPORTED)
|
|
|
|
set_target_properties (Opus::opus PROPERTIES
|
Opus file support
Ogg: Introduce new functions ogg_sync_fseek(), ogg_ftell(), ogg_next_page(),
ogg_stream_next_page(), ogg_sync_last_page_before(), and
ogg_stream_unpack_page(). Use ogg_sync_* for ogg_read_first_page(). Bump libogg
version requirement from 1.1.3 to 1.3.0 as LibOgg 1.3.0 is required for
ogg_stream_pageout_fill() and ogg_stream_flush_fill().
Opus: Add opus support. Document added commands
SFC_(GET|SET)_ORIGINAL_SAMPLERATE. Added or extended tests ogg_opus_test,
compression_size_test, floating_point_test, lossy_comp_test, string_test,
external_libs_test. Change Opus to non-experimental.
2018-07-09 21:37:06 +00:00
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${OPUS_INCLUDE_DIRS}"
|
|
|
|
IMPORTED_LOCATION "${OPUS_LIBRARIES}"
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
mark_as_advanced(OPUS_INCLUDE_DIR OPUS_LIBRARY)
|