Make Qt-Compositor build the xcomposite backend as default
authorJørgen Lind <jorgen.lind@nokia.com>
Mon, 11 Apr 2011 12:00:15 +0000 (14:00 +0200)
committerJørgen Lind <jorgen.lind@nokia.com>
Mon, 11 Apr 2011 12:01:26 +0000 (14:01 +0200)
when Qt is built with opengl. Other plugins can be set by defining the
environment variable: QT_WAYLAND_GL_CONFIG

examples/qml-compositor/qml-compositor.pro
examples/qwidget-compositor/qt-compositor.pro
src/qt-compositor/hardware_integration/dri2_xcb/dri2_xcb.pri
src/qt-compositor/hardware_integration/hardware_integration.pri
src/qt-compositor/hardware_integration/mesa_egl/mesa_egl.pri
src/qt-compositor/qt-compositor.pri

index 050a247..8fb49fb 100644 (file)
@@ -7,11 +7,6 @@ TARGET = qml-compositor
 DEPENDPATH += .
 INCLUDEPATH += .
 
-# comment out the following CONFIG lines to disable DRM
-#CONFIG += wayland_gl
-#CONFIG += mesa_egl
-#CONFIG += dri2_xcb
-
 # comment out the following to not use pkg-config in the pri files
 CONFIG += use_pkgconfig
 
index 0c0001f..bd921a4 100644 (file)
@@ -3,13 +3,6 @@ TARGET = qwidget-compositor
 DEPENDPATH += .
 INCLUDEPATH += .
 
-# comment out the following CONFIG lines to disable DRM
-#CONFIG += wayland_gl
-#CONFIG += mesa_egl
-#CONFIG += dri2_xcb
-#CONFIG += xcomposite_glx
-#CONFIG += xcomposite_egl
-
 # comment out the following to not use pkg-config in the pri files
 CONFIG += use_pkgconfig
 
index a86a5f7..641c7a9 100644 (file)
@@ -1,6 +1,8 @@
 INCLUDEPATH += $$PWD/../private
 LIBS += -lxcb -lxcb-dri2 -lEGL
 
+DEFINES += QT_COMPOSITOR_DRI2_XCB
+
 SOURCES += \
     $$PWD/dri2xcbhwintegration.cpp \
     $$PWD/dri2xcbbuffer.cpp \
index 7e5ec42..8c82d08 100644 (file)
@@ -1,30 +1,43 @@
+contains(QT_CONFIG, opengl) {
 HEADERS += \
     $$PWD/graphicshardwareintegration.h
 
 SOURCES += \
     $$PWD/graphicshardwareintegration.cpp
 
-wayland_gl{
-    contains(QT_CONFIG, opengl) {
-        DEFINES += QT_WAYLAND_GL_SUPPORT
-        QT += opengl
+    DEFINES += QT_COMPOSITOR_WAYLAND_GL
+    QT += opengl
 
-        contains(QT_CONFIG, opengles2) {
-            mesa_egl {
-                include (mesa_egl/mesa_egl.pri)
-                DEFINES += QT_COMPOSITOR_MESA_EGL
-            }
-            dri2_xcb {
-                include (dri2_xcb/dri2_xcb.pri)
-                DEFINES += QT_COMPOSITOR_DRI2_XCB
-            }
-            xcomposite_egl {
-                include (xcomposite_egl/xcomposite_egl.pri)
-            }
+    QT_WAYLAND_GL_CONFIG = $$(QT_WAYLAND_GL_CONFIG)
+    contains(QT_CONFIG, opengles2) {
+        isEqual(QT_WAYLAND_GL_CONFIG, wayland_egl) {
+            QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG
+            CONFIG += mesa_egl
+        } else:isEqual(QT_WAYLAND_GL_CONFIG,dri2_xcb) {
+            QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG
+            CONFIG += dri2_xcb
         } else {
-            xcomposite_glx {
-                include (xcomposite_glx/xcomposite_glx.pri)
-            }
+            QT_WAYLAND_GL_INTEGRATION = xcomposite_egl
+            CONFIG += xcomposite_egl
         }
+    } else {
+        QT_WAYLAND_GL_INTEGRATION = xcomposite_glx
+        CONFIG += xcomposite_glx
     }
+    system(echo "Qt-Compositor configured with openGL: $$QT_WAYLAND_GL_INTEGRATION")
+} else {
+    system(echo "Qt-Compositor configured as raster only compositor")
+}
+
+mesa_egl {
+    include (mesa_egl/mesa_egl.pri)
+}
+dri2_xcb {
+    include (dri2_xcb/dri2_xcb.pri)
+}
+xcomposite_egl {
+    include (xcomposite_egl/xcomposite_egl.pri)
+}
+xcomposite_glx {
+    include (xcomposite_glx/xcomposite_glx.pri)
 }
index bee73c1..1ac2dad 100644 (file)
@@ -1,5 +1,7 @@
 LIBS += -lEGL
 
+DEFINES += QT_COMPOSITOR_MESA_EGL
+
 SOURCES += \
     $$PWD/mesaeglintegration.cpp
 
index 048a458..a3b1cf8 100644 (file)
@@ -16,14 +16,6 @@ use_pkgconfig {
     LIBS += -lwayland-server -lffi
 }
 
-wayland_gl {
-    system(echo "Qt-Compositor configured with openGL")
-    QT += opengl
-    DEFINES += QT_COMPOSITOR_WAYLAND_GL
-} else {
-    system(echo "Qt-Compositor configured as raster only compositor")
-}
-
 include ($$PWD/util/util.pri)
 include ($$PWD/wayland_wrapper/wayland_wrapper.pri)
 include ($$PWD/hardware_integration/hardware_integration.pri)