[vlc-commits] Qt: use QX11Info on Qt5 when present

Rafaël Carré git at videolan.org
Wed Jul 30 12:17:24 CEST 2014


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Wed Jul 30 12:16:52 2014 +0200| [96d10f508bb9fb59f6396329f692923eb266ff0d] | committer: Rafaël Carré

Qt: use QX11Info on Qt5 when present

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=96d10f508bb9fb59f6396329f692923eb266ff0d
---

 configure.ac                                     |    4 ++++
 modules/gui/qt4/Makefile.am                      |    4 ++--
 modules/gui/qt4/components/interface_widgets.cpp |    4 ++++
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0654541..ab18dd7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3730,6 +3730,10 @@ AC_ARG_ENABLE(qt, [
 ])
 AS_IF([test "${enable_qt}" != "no"], [
   PKG_CHECK_MODULES([QT], [Qt5Core >= 5.1.0 Qt5Widgets Qt5Gui], [
+      PKG_CHECK_MODULES([QTX11], [Qt5X11Extras], [
+          VLC_ADD_LIBS([qt4],[${QTX11_LIBS}])
+          VLC_ADD_CXXFLAGS([qt4],[${QTX11_CFLAGS} -DQT5_HAS_X11])
+      ])
       QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
       QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
       AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, [${QT_HOST_PATH} ${QT_PATH}/bin ${CONTRIB_DIR}/bin])
diff --git a/modules/gui/qt4/Makefile.am b/modules/gui/qt4/Makefile.am
index a4fec79..c608999 100644
--- a/modules/gui/qt4/Makefile.am
+++ b/modules/gui/qt4/Makefile.am
@@ -14,8 +14,8 @@ guidir = $(pluginsdir)/gui
 
 SUFFIXES += .ui .h .hpp .moc.cpp
 
-libqt4_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS)
-libqt4_plugin_la_LIBADD = $(QT_LIBS)
+libqt4_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) $(CXXFLAGS_qt4)
+libqt4_plugin_la_LIBADD = $(QT_LIBS) $(LIBS_qt4)
 libqt4_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(guidir)'
 if HAVE_OS2
 else
diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 6d27876..fc93436 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -52,6 +52,10 @@
 #include <QBitmap>
 #include <QUrl>
 
+#ifdef QT5_HAS_X11
+# define Q_WS_X11
+#endif
+
 #ifdef Q_WS_X11
 #   include <X11/Xlib.h>
 #   include <qx11info_x11.h>



More information about the vlc-commits mailing list