2016-07-26 08:41:17 +00:00
|
|
|
# - Find ogg
|
|
|
|
# Find the native ogg includes and libraries
|
|
|
|
#
|
|
|
|
# OGG_INCLUDE_DIRS - where to find ogg.h, etc.
|
|
|
|
# OGG_LIBRARIES - List of libraries when using ogg.
|
2018-08-19 03:56:17 +00:00
|
|
|
# OGG_FOUND - True if ogg found.
|
2016-07-26 08:41:17 +00:00
|
|
|
|
2018-08-19 03:56:17 +00:00
|
|
|
if (OGG_INCLUDE_DIR)
|
|
|
|
# Already in cache, be silent
|
|
|
|
set(OGG_FIND_QUIETLY TRUE)
|
|
|
|
endif ()
|
2016-07-26 08:41:17 +00:00
|
|
|
|
|
|
|
find_package (PkgConfig QUIET)
|
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
|
|
|
pkg_check_modules (PC_OGG QUIET ogg>=1.3.0)
|
2016-07-26 08:41:17 +00:00
|
|
|
|
2018-08-19 03:56:17 +00:00
|
|
|
set (OGG_VERSION ${PC_OGG_VERSION})
|
|
|
|
|
|
|
|
find_path (OGG_INCLUDE_DIR ogg/ogg.h
|
|
|
|
HINTS
|
|
|
|
${PC_OGG_INCLUDEDIR}
|
|
|
|
${PC_OGG_INCLUDE_DIRS}
|
|
|
|
${OGG_ROOT}
|
|
|
|
)
|
2016-07-26 08:41:17 +00:00
|
|
|
# MSVC built ogg may be named ogg_static.
|
|
|
|
# The provided project files name the library with the lib prefix.
|
2018-08-19 03:56:17 +00:00
|
|
|
find_library (OGG_LIBRARY
|
|
|
|
NAMES
|
|
|
|
ogg
|
|
|
|
ogg_static
|
|
|
|
libogg
|
|
|
|
libogg_static
|
|
|
|
HINTS
|
|
|
|
${PC_OGG_LIBDIR}
|
|
|
|
${PC_OGG_LIBRARY_DIRS}
|
|
|
|
${OGG_ROOT}
|
|
|
|
)
|
2016-07-26 08:41:17 +00:00
|
|
|
# Handle the QUIETLY and REQUIRED arguments and set OGG_FOUND
|
|
|
|
# to TRUE if all listed variables are TRUE.
|
2018-08-19 03:56:17 +00:00
|
|
|
include (FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args (Ogg
|
|
|
|
REQUIRED_VARS
|
|
|
|
OGG_LIBRARY
|
|
|
|
OGG_INCLUDE_DIR
|
|
|
|
VERSION_VAR
|
|
|
|
OGG_VERSION
|
|
|
|
)
|
2016-07-26 08:41:17 +00:00
|
|
|
|
|
|
|
if (OGG_FOUND)
|
|
|
|
set (OGG_LIBRARIES ${OGG_LIBRARY})
|
|
|
|
set (OGG_INCLUDE_DIRS ${OGG_INCLUDE_DIR})
|
2018-08-19 03:56:17 +00:00
|
|
|
|
2020-03-08 05:28:46 +00:00
|
|
|
if(NOT TARGET Ogg::ogg)
|
|
|
|
add_library(Ogg::ogg UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(Ogg::ogg PROPERTIES
|
2018-08-19 03:56:17 +00:00
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${OGG_INCLUDE_DIRS}"
|
|
|
|
IMPORTED_LOCATION "${OGG_LIBRARIES}"
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
endif ()
|
2016-07-26 08:41:17 +00:00
|
|
|
|
2018-08-19 03:56:17 +00:00
|
|
|
mark_as_advanced (OGG_INCLUDE_DIR OGG_LIBRARY)
|