2018-08-19 03:56:17 +00:00
|
|
|
# - Find vorbisenc
|
|
|
|
# Find the native vorbisenc includes and libraries
|
2016-07-26 08:41:17 +00:00
|
|
|
#
|
|
|
|
# VORBIS_INCLUDE_DIRS - where to find vorbis.h, etc.
|
2018-08-19 03:56:17 +00:00
|
|
|
# VORBIS_LIBRARIES - List of libraries when using vorbis.
|
|
|
|
# VORBIS_FOUND - True if vorbis found.
|
2016-07-26 08:41:17 +00:00
|
|
|
|
2018-08-19 03:56:17 +00:00
|
|
|
if (VORBIS_INCLUDE_DIR)
|
2016-07-26 08:41:17 +00:00
|
|
|
# Already in cache, be silent
|
2018-08-19 03:56:17 +00:00
|
|
|
set (VORBIS_FIND_QUIETLY TRUE)
|
|
|
|
endif ()
|
2016-07-26 08:41:17 +00:00
|
|
|
|
|
|
|
find_package (Ogg QUIET)
|
|
|
|
|
|
|
|
find_package (PkgConfig QUIET)
|
2018-08-19 03:56:17 +00:00
|
|
|
pkg_check_modules (PC_VORBIS QUIET vorbis)
|
|
|
|
|
|
|
|
set (VORBIS_VERSION ${PC_VORBIS_VERSION})
|
|
|
|
|
|
|
|
find_path (VORBIS_INCLUDE_DIR vorbis/codec.h
|
|
|
|
HINTS
|
|
|
|
${PC_VORBIS_INCLUDEDIR}
|
|
|
|
${PC_VORBIS_INCLUDE_DIRS}
|
|
|
|
${VORBIS_ROOT}
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library (VORBIS_LIBRARY
|
|
|
|
NAMES
|
|
|
|
vorbis
|
|
|
|
vorbis_static
|
|
|
|
libvorbis
|
|
|
|
libvorbis_static
|
|
|
|
HINTS
|
|
|
|
${PC_VORBIS_LIBDIR}
|
|
|
|
${PC_VORBIS_LIBRARY_DIRS}
|
|
|
|
${VORBIS_ROOT}
|
|
|
|
)
|
2016-07-26 08:41:17 +00:00
|
|
|
|
|
|
|
# Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
|
|
|
|
# to TRUE if all listed variables are TRUE.
|
2018-08-19 03:56:17 +00:00
|
|
|
include (FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args (Vorbis
|
|
|
|
REQUIRED_VARS
|
|
|
|
VORBIS_LIBRARY
|
|
|
|
VORBIS_INCLUDE_DIR
|
|
|
|
OGG_FOUND
|
|
|
|
VERSION_VAR
|
|
|
|
VORBIS_VERSION
|
|
|
|
)
|
2016-07-26 08:41:17 +00:00
|
|
|
|
|
|
|
if (VORBIS_FOUND)
|
2018-08-19 03:56:17 +00:00
|
|
|
set (VORBIS_INCLUDE_DIRS ${VORBIS_INCLUDE_DIR})
|
|
|
|
set (VORBIS_LIBRARIES ${VORBIS_LIBRARY} ${OGG_LIBRARIES})
|
|
|
|
if (NOT TARGET Vorbis::Vorbis)
|
|
|
|
add_library (Vorbis::Vorbis UNKNOWN IMPORTED)
|
|
|
|
set_target_properties (Vorbis::Vorbis PROPERTIES
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${VORBIS_INCLUDE_DIR}"
|
|
|
|
IMPORTED_LOCATION "${VORBIS_LIBRARY}"
|
2020-03-08 05:28:46 +00:00
|
|
|
INTERFACE_LINK_LIBRARIES Ogg::ogg
|
2018-08-19 03:56:17 +00:00
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
endif ()
|
2016-07-26 08:41:17 +00:00
|
|
|
|
2018-08-19 03:56:17 +00:00
|
|
|
mark_as_advanced (VORBIS_INCLUDE_DIR VORBIS_LIBRARY)
|