diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-05-12 02:00:13 +0300 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-05-12 02:00:13 +0300 |
commit | 2ecba800bfbf177bc56999dc59ecdff00cbc353c (patch) | |
tree | 5a5f8a486c1f56a903d23af3f98e246c1aed9c7d /tests | |
parent | d8f0deadc3533ad0f5b3aef8c2da5a3192f658b7 (diff) |
meson: Revamp qt5qml plugin and example build code
Stricter and simpler. For example, now we properly error out when
gstreamer-gl-1.0 was not found when the qt5 plugin is enabled or when
a C++ compiler is not enabled.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/587>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examples/qt/meson.build | 16 | ||||
-rw-r--r-- | tests/examples/qt/qmloverlay/meson.build | 22 | ||||
-rw-r--r-- | tests/examples/qt/qmlsink-dynamically-added/meson.build | 22 | ||||
-rw-r--r-- | tests/examples/qt/qmlsink/meson.build | 22 | ||||
-rw-r--r-- | tests/examples/qt/qmlsrc/meson.build | 21 |
5 files changed, 40 insertions, 63 deletions
diff --git a/tests/examples/qt/meson.build b/tests/examples/qt/meson.build index 1135f1740..ede4b5a44 100644 --- a/tests/examples/qt/meson.build +++ b/tests/examples/qt/meson.build @@ -1,3 +1,19 @@ +if qt5_option.disabled() + subdir_done() +endif + +# We already did all the checks when building the qt plugin +if not qt5qml_dep.found() + subdir_done() +endif + +qt5qml_example_deps = dependency('qt5', modules : ['Core', 'Gui', 'Widgets', 'Qml', 'Quick'], + required: get_option('examples')) + +if not qt5qml_example_deps.found() + subdir_done() +endif + subdir('qmloverlay') subdir('qmlsink') subdir('qmlsink-dynamically-added') diff --git a/tests/examples/qt/qmloverlay/meson.build b/tests/examples/qt/qmloverlay/meson.build index 57a538333..ccf27e9e5 100644 --- a/tests/examples/qt/qmloverlay/meson.build +++ b/tests/examples/qt/qmloverlay/meson.build @@ -2,19 +2,9 @@ sources = [ 'main.cpp', ] -if have_cxx and build_gstgl and gstgl_dep.found() - qt5_mod = import('qt5') - qt5qml_deps = dependency('qt5', modules : ['Core', 'Gui', 'Widgets', 'Qml', 'Quick'], - required: get_option('examples')) - - # FIXME Add a way to get that information out of the qt5 module - moc = find_program('moc-qt5', 'moc', required : get_option('examples')) - if qt5qml_deps.found() and moc.found() - qt_preprocessed = qt5_mod.preprocess(qresources : 'qmloverlay.qrc') - executable('qmlgloverlay', sources, qt_preprocessed, - dependencies : [gst_dep, qt5qml_deps], - c_args : gst_plugins_good_args, - include_directories : [configinc], - install: false) - endif -endif +qt_preprocessed = qt5_mod.preprocess(qresources : 'qmloverlay.qrc') +executable('qmlgloverlay', sources, qt_preprocessed, + dependencies : [gst_dep, qt5qml_example_deps], + c_args : gst_plugins_good_args, + include_directories : [configinc], + install: false) diff --git a/tests/examples/qt/qmlsink-dynamically-added/meson.build b/tests/examples/qt/qmlsink-dynamically-added/meson.build index ebee3b04c..b4eb78b9c 100644 --- a/tests/examples/qt/qmlsink-dynamically-added/meson.build +++ b/tests/examples/qt/qmlsink-dynamically-added/meson.build @@ -2,19 +2,9 @@ sources = [ 'main.cpp', ] -if have_cxx and build_gstgl and gstgl_dep.found() - qt5_mod = import('qt5') - qt5qml_deps = dependency('qt5', modules : ['Core', 'Gui', 'Widgets', 'Qml', 'Quick'], - required: get_option('examples')) - - # FIXME Add a way to get that information out of the qt5 module - moc = find_program('moc-qt5', 'moc', required : get_option('examples')) - if qt5qml_deps.found() and moc.found() - qt_preprocessed = qt5_mod.preprocess(qresources : 'qmlsink.qrc') - executable('qmlsink-dynamically-added', sources, qt_preprocessed, - dependencies : [gst_dep, gstgl_dep, qt5qml_deps], - c_args : gst_plugins_good_args, - include_directories : [configinc], - install: false) - endif -endif +qt_preprocessed = qt5_mod.preprocess(qresources : 'qmlsink.qrc') +executable('qmlsink-dynamically-added', sources, qt_preprocessed, + dependencies : [gst_dep, gstgl_dep, qt5qml_example_deps], + c_args : gst_plugins_good_args, + include_directories : [configinc], + install: false) diff --git a/tests/examples/qt/qmlsink/meson.build b/tests/examples/qt/qmlsink/meson.build index 2f444372d..f2a7a1674 100644 --- a/tests/examples/qt/qmlsink/meson.build +++ b/tests/examples/qt/qmlsink/meson.build @@ -2,19 +2,9 @@ sources = [ 'main.cpp', ] -if have_cxx and build_gstgl and gstgl_dep.found() - qt5_mod = import('qt5') - qt5qml_deps = dependency('qt5', modules : ['Core', 'Gui', 'Widgets', 'Qml', 'Quick'], - required: get_option('examples')) - - # FIXME Add a way to get that information out of the qt5 module - moc = find_program('moc-qt5', 'moc', required : get_option('examples')) - if qt5qml_deps.found() and moc.found() - qt_preprocessed = qt5_mod.preprocess(qresources : 'qmlsink.qrc') - executable('qmlsink', sources, qt_preprocessed, - dependencies : [gst_dep, qt5qml_deps], - c_args : gst_plugins_good_args, - include_directories : [configinc], - install: false) - endif -endif +qt_preprocessed = qt5_mod.preprocess(qresources : 'qmlsink.qrc') +executable('qmlsink', sources, qt_preprocessed, + dependencies : [gst_dep, qt5qml_example_deps], + c_args : gst_plugins_good_args, + include_directories : [configinc], + install: false) diff --git a/tests/examples/qt/qmlsrc/meson.build b/tests/examples/qt/qmlsrc/meson.build index 122e4a617..3d55a28cb 100644 --- a/tests/examples/qt/qmlsrc/meson.build +++ b/tests/examples/qt/qmlsrc/meson.build @@ -2,18 +2,9 @@ sources = [ 'main.cpp', ] -if have_cxx and build_gstgl and gstgl_dep.found() - qt5_mod = import('qt5') - qt5qml_deps = dependency('qt5', modules : ['Core', 'Gui', 'Widgets', 'Qml', 'Quick'], - required: get_option('examples')) - # FIXME Add a way to get that information out of the qt5 module - moc = find_program('moc-qt5', 'moc', required : get_option('examples')) - if qt5qml_deps.found() and moc.found() - qt_preprocessed = qt5_mod.preprocess(qresources : 'qmlsrc.qrc') - executable('qmlsrc', sources, qt_preprocessed, - dependencies : [gst_dep, qt5qml_deps], - c_args : gst_plugins_good_args, - include_directories : [configinc], - install: false) - endif -endif +qt_preprocessed = qt5_mod.preprocess(qresources : 'qmlsrc.qrc') +executable('qmlsrc', sources, qt_preprocessed, + dependencies : [gst_dep, qt5qml_example_deps], + c_args : gst_plugins_good_args, + include_directories : [configinc], + install: false) |