meson: Rework build files for qt examples in -base
The build files had quite a few things wrong: * Not using the method: kwarg, which can cause the wrong Qt to be used for building * There was no way to enable the build for them * Qt was being detected multiple times, differently * Unnecessary check for libGL * have_cxx was being used incorrectly * Qt tool detection was outdated Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9046>
This commit is contained in:
parent
0ba85c84a1
commit
32eaa0ae35
@ -76,6 +76,10 @@ option('tools', type : 'feature', value : 'auto', yield : true)
|
|||||||
option('introspection', type : 'feature', value : 'auto', yield : true, description : 'Generate gobject-introspection bindings')
|
option('introspection', type : 'feature', value : 'auto', yield : true, description : 'Generate gobject-introspection bindings')
|
||||||
option('nls', type : 'feature', value : 'auto', yield: true, description : 'Enable native language support (translations)')
|
option('nls', type : 'feature', value : 'auto', yield: true, description : 'Enable native language support (translations)')
|
||||||
option('orc', type : 'feature', value : 'auto', yield : true)
|
option('orc', type : 'feature', value : 'auto', yield : true)
|
||||||
|
|
||||||
|
# Qt tests options
|
||||||
|
option('qt-method', type: 'combo', value: 'auto', choices: ['auto', 'pkg-config', 'qmake'],
|
||||||
|
description: 'Method to use to find Qt')
|
||||||
option('qt5', type : 'feature', value : 'auto', yield : true, description : 'Qt5 QML examples')
|
option('qt5', type : 'feature', value : 'auto', yield : true, description : 'Qt5 QML examples')
|
||||||
|
|
||||||
# Common options
|
# Common options
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
subdir('cocoa')
|
subdir('cocoa')
|
||||||
subdir('generic')
|
subdir('generic')
|
||||||
subdir('gtk', if_found: gtk_dep)
|
subdir('gtk', if_found: gtk_dep)
|
||||||
qt5core_dep = dependency('qt5', modules : ['Core'], required : false)
|
subdir('qt', if_found: qt5gui_dep)
|
||||||
subdir('qt', if_found: qt5core_dep)
|
|
||||||
subdir('sdl')
|
subdir('sdl')
|
||||||
|
@ -1,23 +1,18 @@
|
|||||||
if get_option('qt5').disabled()
|
qt_cxx_warn_less = cxx.get_supported_arguments(['-Wno-aggregate-return'])
|
||||||
|
|
||||||
|
subdir('videooverlay')
|
||||||
|
|
||||||
|
if not qt5_have_tools
|
||||||
subdir_done()
|
subdir_done()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
qt5_mod = import('qt5')
|
|
||||||
|
|
||||||
qt5gui_dep = dependency('qt5', modules : ['Core', 'Gui', 'Widgets'], required : false)
|
|
||||||
qt5opengl_dep = dependency('qt5', modules : ['OpenGL'], required : false)
|
|
||||||
#FIXME; other platforms
|
|
||||||
libgl = cc.find_library ('GL', required : false)
|
|
||||||
|
|
||||||
qt_cxx_warn_less = cxx.get_supported_arguments(['-Wno-aggregate-return'])
|
|
||||||
|
|
||||||
if qt5gui_dep.found()
|
|
||||||
subdir('videooverlay')
|
|
||||||
if libgl.found()
|
|
||||||
subdir('mousevideooverlay')
|
subdir('mousevideooverlay')
|
||||||
|
|
||||||
|
gl_option = get_option('gl')
|
||||||
|
qt5gl_option = qt5_option.disable_auto_if(not gstgl_dep.found())
|
||||||
|
qt5opengl_dep = dependency('qt5', modules: ['OpenGL'], method: qt5_method,
|
||||||
|
required: qt5gl_option.enabled() and gl_option.enabled() and examples_option.enabled())
|
||||||
if qt5opengl_dep.found()
|
if qt5opengl_dep.found()
|
||||||
subdir('qglwidgetvideooverlay')
|
subdir('qglwidgetvideooverlay')
|
||||||
subdir('qglwtextureshare')
|
subdir('qglwtextureshare')
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
@ -11,9 +11,9 @@ moc_headers = [
|
|||||||
'qrenderer.h',
|
'qrenderer.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
|
moc_files = qt5_mod.preprocess(moc_headers: moc_headers, method: qt5_method)
|
||||||
executable('mousevideoverlay', sources, moc_files,
|
executable('mousevideoverlay', sources, moc_files,
|
||||||
cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less,
|
cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less,
|
||||||
include_directories: [configinc, libsinc],
|
include_directories: [configinc, libsinc],
|
||||||
dependencies : [qt5core_dep, qt5gui_dep, gst_dep, video_dep, gstgl_dep, gstglproto_dep],
|
dependencies : [qt5gui_dep, gst_dep, video_dep, gstgl_dep, gstglproto_dep],
|
||||||
install: false)
|
install: false)
|
||||||
|
@ -11,9 +11,9 @@ moc_headers = [
|
|||||||
'qglrenderer.h',
|
'qglrenderer.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
|
moc_files = qt5_mod.preprocess(moc_headers: moc_headers, method: qt5_method)
|
||||||
executable('qglwidgetvideoverlay', sources, moc_files,
|
executable('qglwidgetvideoverlay', sources, moc_files,
|
||||||
cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less,
|
cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less,
|
||||||
include_directories: [configinc, libsinc],
|
include_directories: [configinc, libsinc],
|
||||||
dependencies : [qt5core_dep, qt5gui_dep, qt5opengl_dep, gst_dep, video_dep, gstgl_dep, gstglproto_dep],
|
dependencies : [qt5gui_dep, qt5opengl_dep, gst_dep, video_dep, gstgl_dep, gstglproto_dep],
|
||||||
install: false)
|
install: false)
|
||||||
|
@ -13,7 +13,8 @@ moc_headers = [
|
|||||||
|
|
||||||
qtwinsys_deps = []
|
qtwinsys_deps = []
|
||||||
if enabled_gl_winsys.contains('x11') and enabled_gl_platforms.contains('glx')
|
if enabled_gl_winsys.contains('x11') and enabled_gl_platforms.contains('glx')
|
||||||
qt5x11extras = dependency('qt5', modules : ['X11Extras'], required : false)
|
qt5x11extras = dependency('qt5', modules: ['X11Extras'], method: qt5_method,
|
||||||
|
required: qt5_option)
|
||||||
if qt5x11extras.found()
|
if qt5x11extras.found()
|
||||||
qtwinsys_deps += [qt5x11extras, glx_dep]
|
qtwinsys_deps += [qt5x11extras, glx_dep]
|
||||||
else
|
else
|
||||||
@ -21,9 +22,9 @@ if enabled_gl_winsys.contains('x11') and enabled_gl_platforms.contains('glx')
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
|
moc_files = qt5_mod.preprocess(moc_headers: moc_headers, method: qt5_method)
|
||||||
executable('qglwtextureshare', sources, moc_files,
|
executable('qglwtextureshare', sources, moc_files,
|
||||||
cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less,
|
cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less,
|
||||||
include_directories: [configinc, libsinc],
|
include_directories: [configinc, libsinc],
|
||||||
dependencies : [qt5core_dep, qt5gui_dep, qt5opengl_dep, qtwinsys_deps, gst_dep, video_dep, gstgl_dep, gstglproto_dep],
|
dependencies : [qt5gui_dep, qt5opengl_dep, qtwinsys_deps, gst_dep, video_dep, gstgl_dep, gstglproto_dep],
|
||||||
install: false)
|
install: false)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
executable('videoverlay', 'videooverlay.cpp',
|
executable('videoverlay', 'videooverlay.cpp',
|
||||||
cpp_args : [gst_plugins_base_args],
|
cpp_args : [gst_plugins_base_args],
|
||||||
include_directories: [configinc, libsinc],
|
include_directories: [configinc, libsinc],
|
||||||
dependencies : [qt5core_dep, qt5gui_dep, gst_dep, video_dep],
|
dependencies : [qt5gui_dep, gst_dep, video_dep],
|
||||||
install: false)
|
install: false)
|
||||||
|
@ -7,10 +7,34 @@ subdir('decodebin_next')
|
|||||||
subdir('encoding')
|
subdir('encoding')
|
||||||
subdir('fft')
|
subdir('fft')
|
||||||
subdir('gio')
|
subdir('gio')
|
||||||
if build_gstgl
|
|
||||||
|
# Qt is used by gl/qt and overlay examples
|
||||||
|
examples_option = get_option('examples')
|
||||||
|
qt5_method = get_option('qt-method')
|
||||||
|
qt5_option = get_option('qt5').require(have_cxx)
|
||||||
|
qt5_option = qt5_option.disable_auto_if(examples_option.disabled())
|
||||||
|
|
||||||
|
qt5gui_dep = dependency('', required: false)
|
||||||
|
qt5opengl_dep = dependency('', required: false)
|
||||||
|
qt5_have_tools = false
|
||||||
|
qt5_mod = import('qt5')
|
||||||
|
if qt5_option.allowed()
|
||||||
|
qt5gui_dep = dependency('qt5', modules: ['Core', 'Gui', 'Widgets'], method: qt5_method,
|
||||||
|
required: qt5_option.enabled() and examples_option.enabled())
|
||||||
|
if meson.version().version_compare('>=1.6')
|
||||||
|
qt5_have_tools = qt5_mod.has_tools(method: qt5_method, tools: ['moc', 'uic', 'rcc'],
|
||||||
|
required: qt5_option.enabled() and examples_option.enabled())
|
||||||
|
else
|
||||||
|
qt5_have_tools = qt5_mod.has_tools(method: qt5_method,
|
||||||
|
required: qt5_option.enabled() and examples_option.enabled())
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if gstgl_dep.found()
|
||||||
subdir('gl')
|
subdir('gl')
|
||||||
endif
|
endif
|
||||||
subdir('overlay')
|
subdir('overlay')
|
||||||
|
|
||||||
subdir('overlaycomposition')
|
subdir('overlaycomposition')
|
||||||
subdir('playback')
|
subdir('playback')
|
||||||
subdir('playrec')
|
subdir('playrec')
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
if get_option('qt5').disabled()
|
if x11_dep.found() and gtk_x11_dep.found()
|
||||||
subdir_done()
|
|
||||||
endif
|
|
||||||
|
|
||||||
if x11_dep.found()
|
|
||||||
if gtk_x11_dep.found()
|
|
||||||
executable('gtk-videooverlay', 'gtk-videooverlay.c',
|
executable('gtk-videooverlay', 'gtk-videooverlay.c',
|
||||||
c_args : gst_plugins_base_args,
|
c_args : gst_plugins_base_args,
|
||||||
include_directories: [configinc, libsinc],
|
include_directories: [configinc, libsinc],
|
||||||
@ -11,28 +6,24 @@ if x11_dep.found()
|
|||||||
install: false)
|
install: false)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if have_cxx # check for C++ support
|
if qt5gui_dep.found()
|
||||||
qt5_mod = import('qt5')
|
|
||||||
qt5widgets_dep = dependency('qt5', modules : ['Core', 'Gui', 'Widgets'],
|
|
||||||
required: get_option('examples'))
|
|
||||||
|
|
||||||
if qt5widgets_dep.found() and qt5_mod.has_tools(required: get_option('examples'))
|
|
||||||
executable('qt-videooverlay', 'qt-videooverlay.cpp',
|
executable('qt-videooverlay', 'qt-videooverlay.cpp',
|
||||||
cpp_args : gst_plugins_base_args,
|
cpp_args : gst_plugins_base_args,
|
||||||
include_directories: [configinc, libsinc],
|
include_directories: [configinc, libsinc],
|
||||||
dependencies : [gst_dep, video_dep, libm, x11_dep, qt5widgets_dep],
|
dependencies: [gst_dep, video_dep, libm, x11_dep, qt5gui_dep],
|
||||||
install: false)
|
install: false)
|
||||||
|
|
||||||
|
if qt5_have_tools
|
||||||
# FIXME: this doesn't work properly yet, no moc_qtgv-videooverlay.cpp generated
|
# FIXME: this doesn't work properly yet, no moc_qtgv-videooverlay.cpp generated
|
||||||
moc_files = qt5_mod.preprocess(moc_headers : 'qtgv-videooverlay.h')#moc_sources : 'qtgv-videooverlay.cpp')
|
# moc_sources : 'qtgv-videooverlay.cpp'
|
||||||
|
moc_files = qt5_mod.preprocess(moc_headers: 'qtgv-videooverlay.h', method: qt5_method)
|
||||||
executable('qtgv-videooverlay', 'qtgv-videooverlay.cpp', moc_files,
|
executable('qtgv-videooverlay', 'qtgv-videooverlay.cpp', moc_files,
|
||||||
cpp_args : gst_plugins_base_args,
|
cpp_args : gst_plugins_base_args,
|
||||||
include_directories: [configinc, libsinc],
|
include_directories: [configinc, libsinc],
|
||||||
dependencies : [gst_dep, video_dep, libm, x11_dep, qt5widgets_dep],
|
dependencies : [gst_dep, video_dep, libm, x11_dep, qt5gui_dep],
|
||||||
install: false)
|
install: false)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
if host_system == 'windows'
|
if host_system == 'windows'
|
||||||
executable('win32-videooverlay', 'win32-videooverlay.c',
|
executable('win32-videooverlay', 'win32-videooverlay.c',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user