Skip to content
Snippets Groups Projects
Commit fcca24cb authored by Nirbheek Chauhan's avatar Nirbheek Chauhan :ant:
Browse files

qt: Rework how we find the Qt QPA header

Instead of querying the Qt include path from the dependency or from
qmake, rely on the qt5qml_dep to set the include path to QtGui
correctly, and look for the header inside the private includedir.

Then we can use that path to include the header directly.

Reported in gstreamer/gst-plugins-base#780 (comment 548092)
parent ef5323f5
No related branches found
No related tags found
No related merge requests found
Pipeline #168399 waiting for manual action
......@@ -34,7 +34,7 @@
#if GST_GL_HAVE_PLATFORM_EGL && (defined (HAVE_QT_WAYLAND) || defined (HAVE_QT_EGLFS) || defined (HAVE_QT_ANDROID))
#include <gst/gl/egl/gstegl.h>
#ifdef HAVE_QT_QPA_HEADER
#include <qpa/qplatformnativeinterface.h>
#include QT_QPA_HEADER
#endif
#include <QtPlatformHeaders/QEGLNativeContext>
#include <gst/gl/egl/gstgldisplay_egl.h>
......
......@@ -63,40 +63,14 @@ qt_defines = []
have_qpa_include = false
have_qt_windowing = false
# Attempt to find the QPA header either through pkg-config (preferred) or qmake
# This semi-matches what meson does internally with the qt5 module
# FIXME Add a way to get some of this information out of the qt5 module
if not have_qpa_include
# FIXME: automagic
qt5core_dep = dependency('Qt5Core', required: false)
if qt5core_dep.found() and qt5core_dep.type_name() == 'pkgconfig'
qt_version = qt5core_dep.version()
qt_include_dir = qt5core_dep.get_pkgconfig_variable('includedir')
qpa_include_path = join_paths(qt_include_dir, 'QtGui', qt_version, 'QtGui')
if cxx.has_header('qpa/qplatformnativeinterface.h',
dependencies : qt5core_dep,
args : '-I' + qpa_include_path)
qt_defines += '-DHAVE_QT_QPA_HEADER'
qt_defines += '-I' + qpa_include_path
have_qpa_include = true
message('Found QPA header using pkg-config')
endif
endif
endif
if not have_qpa_include
qmake = find_program('qmake-qt5', 'qmake')
if qmake.found()
qt_version = run_command(qmake, '-query', 'QT_VERSION').stdout().strip()
qt_include_dir = run_command(qmake, '-query', 'QT_INSTALL_HEADERS').stdout().strip()
qpa_include_path = join_paths(qt_include_dir, 'QtGui', qt_version, 'QtGui')
if cxx.has_header('qpa/qplatformnativeinterface.h',
args : '-I' + qpa_include_path)
qt_defines += '-DHAVE_QT_QPA_HEADER'
qt_defines += '-I' + qpa_include_path
have_qpa_include = true
message('Found QPA header using qmake')
endif
endif
# Look for the QPA platform native interface header
qpa_header_path = join_paths(qt5qml_dep.version(), 'QtGui')
qpa_header = join_paths(qpa_header_path, 'qpa/qplatformnativeinterface.h')
if cxx.has_header(qpa_header, dependencies : qt5qml_dep)
qt_defines += '-DHAVE_QT_QPA_HEADER'
qt_defines += '-DQT_QPA_HEADER=' + '<@0@>'.format(qpa_header)
have_qpa_include = true
message('Found QtGui QPA header in ' + qpa_header_path)
endif
# Try to come up with all the platform/winsys combinations that will work
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment