cmake: Add an option for the gstreamer audio backend

Otherwise it'll become a so-called automagic dependency with no control
over including support for it or not, other than having it installed on
the system or not.
For LIBVLC CMAKE_DISABLE_FIND_PACKAGE can be used, but for
pkg_check_modules no such things exits and we need an explicit option.
This commit is contained in:
Heiko Becker 2023-01-30 22:11:40 +01:00
parent c1c7393b64
commit a973ce547d

View File

@ -18,9 +18,12 @@ set_package_properties(LIBVLC PROPERTIES
URL "https://www.videolan.org/vlc/libvlc.html"
TYPE RECOMMENDED)
find_package(PkgConfig REQUIRED) #finding pkg-config is a helper tool
#using pkg-config to getting Gstreamer
pkg_check_modules(GSTREAMER IMPORTED_TARGET gstreamer-1.0)
option(BUILD_GSTREAMER_BACKEND "Build gstreamer audio backend" ON)
if (BUILD_GSTREAMER_BACKEND)
find_package(PkgConfig REQUIRED) #finding pkg-config is a helper tool
#using pkg-config to getting Gstreamer
pkg_check_modules(GSTREAMER IMPORTED_TARGET gstreamer-1.0)
endif()
#########################################