From 43a99c946ec2187d0e276615d337ad47276f553a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 10 Jun 2018 15:17:39 +0200 Subject: cmake: Add check of libvorbis version This is essential for applications that encode to ogg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 7 ++++++- config.h.cmake | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index c5b7c0fe..c51954e6 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -255,7 +255,12 @@ if( WITH_VORBIS ) tde_message_fatal( "Ogg/Vorbis support are requested, but `libvorbisenc` not found" ) endif( ) - set( HAVE_VORBIS 1 ) + check_library_exists( vorbis vorbis_bitrate_addblock "${VORBIS_LIBRARY_DIRS}" HAVE_VORBIS_2 ) + if( HAVE_VORBIS_2 ) + set( HAVE_VORBIS 2 ) + else( ) + set( HAVE_VORBIS 1 ) + endif( ) set( OGG_VORBIS 1 ) endif( WITH_VORBIS ) diff --git a/config.h.cmake b/config.h.cmake index 61dd9169..812818bb 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -31,7 +31,7 @@ #cmakedefine HAVE_MACHINE_SOUNDCARD_H 1 #cmakedefine HAVE_LIBFLAC 1 -#cmakedefine HAVE_VORBIS 1 +#cmakedefine HAVE_VORBIS @HAVE_VORBIS@ #cmakedefine OGG_VORBIS 1 /* mpeglib */ -- cgit v1.2.1