17 if have_cxx and build_gstgl
18 qt5_mod = import('qt5')
19 qt5qml_dep = dependency('qt5', modules : ['Core', 'Gui', 'Qml', 'Quick'], required: false)
21 # FIXME Add a way to get that information out of the qt5 module
22 moc = find_program('moc-qt5', 'moc', required : false)
23 if qt5qml_dep.found() and moc.found()
26 have_qpa_include = false
27 have_qt_windowing = false
29 # Attempt to find the QPA header either through pkg-config (preferred) or qmake
30 # This semi-matches what meson does internally with the qt5 module
31 # FIXME Add a way to get some of this information out of the qt5 module
32 if not have_qpa_include
33 qt5core_dep = dependency('Qt5Core', required: false)
34 if qt5core_dep.found() and qt5core_dep.type_name() == 'pkgconfig'
35 qt_version = qt5core_dep.version()
36 qt_include_dir = qt5core_dep.get_pkgconfig_variable('includedir')
37 qpa_include_path = join_paths(qt_include_dir, 'QtGui', qt_version, 'QtGui')
38 if cxx.has_header('qpa/qplatformnativeinterface.h',
39 dependencies : qt5core_dep,
40 args : '-I' + qpa_include_path)
41 qt_defines += '-DHAVE_QT_QPA_HEADER'
42 qt_defines += '-I' + qpa_include_path
43 have_qpa_include = true
44 message('Found QPA header using pkg-config')
48 if not have_qpa_include
49 qmake = find_program('qmake')
51 qt_version = run_command(qmake, '-query', 'QT_VERSION').stdout().strip()
52 qt_include_dir = run_command(qmake, '-query', 'QT_INSTALL_HEADERS').stdout().strip()
53 qpa_include_path = join_paths(qt_include_dir, 'QtGui', qt_version, 'QtGui')
54 if cxx.has_header('qpa/qplatformnativeinterface.h',
55 args : '-I' + qpa_include_path)
56 qt_defines += '-DHAVE_QT_QPA_HEADER'
57 qt_defines += '-I' + qpa_include_path
58 have_qpa_include = true
59 message('Found QPA header using qmake')
64 # Try to come up with all the platform/winsys combinations that will work
66 if gst_gl_have_window_x11 and gst_gl_have_platform_glx
67 qt5x11extras = dependency('qt5', modules : ['X11Extras'], required : false)
68 if qt5x11extras.found()
69 optional_deps += qt5x11extras
70 qt_defines += ['-DHAVE_QT_X11']
71 have_qt_windowing = true
75 if gst_gl_have_platform_egl
77 if gst_gl_have_window_wayland
78 qt5waylandextras = dependency('qt5', modules : ['WaylandClient'], required : false)
79 if qt5waylandextras.found()
80 optional_deps += qt5waylandextras
81 qt_defines += ['-DHAVE_QT_WAYLAND']
82 have_qt_windowing = true
85 if gst_gl_have_window_android
87 qt5androidextras = dependency('qt5', modules : ['AndroidExtras'], required : false)
88 if qt5androidextras.found()
89 optional_deps += qt5androidextras
90 # also uses the HAVE_QT_EGLFS define below
91 have_qt_windowing = true
95 qt_defines += ['-DHAVE_QT_EGLFS']
96 have_qt_windowing = true
99 if gst_gl_have_platform_wgl and gst_gl_have_window_win32
100 # for wglMakeCurrent()
101 opengl32_dep = cc.find_library('opengl32', required : false)
102 if opengl32_dep.found()
103 qt_defines += ['-DHAVE_QT_WIN32']
104 optional_deps += opengl32_dep
105 have_qt_windowing = true
109 # FIXME: OSX/iOS definitions
113 moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
114 library('gstqmlgl', sources, moc_files,
115 cpp_args : gst_plugins_good_args + qt_defines,
116 link_args : noseh_link_args,
117 include_directories: [configinc, libsinc],
118 dependencies : [glib_deps, gst_dep, gstvideo_dep, gstgl_dep, qt5qml_dep, optional_deps],
120 install_dir : plugins_install_dir)