[gegl-qt] Qt5: Take all cases into account when checking for QML modules



commit 3bd6a9370b13783cb3a5e8ebb86b4e4e2ba851a2
Author: Jon Nordby <jononor gmail com>
Date:   Sun Mar 11 17:13:22 2012 +0100

    Qt5: Take all cases into account when checking for QML modules
    
    Hurrah for Qt modularization...

 config.pri |   40 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 37 insertions(+), 3 deletions(-)
---
diff --git a/config.pri b/config.pri
index 807b7e7..f4a2cee 100644
--- a/config.pri
+++ b/config.pri
@@ -35,11 +35,45 @@ isEmpty(GEGL_INSTALL_OPERATIONS) {
     GEGL_INSTALL_OPERATIONS = $$GEGL_LIBDIR/gegl-0.1/
 }
 
-# Optional deps
+### Optional deps ###
+# QtDeclarative
 HAVE_QT_DECLARATIVE = yes
-!system(pkg-config QtDeclarative){
+contains(QT_MAJOR_VERSION, 5) {
+    !contains(QT_CONFIG, declarative) {
+        HAVE_QT_DECLARATIVE = no
+    }
+} else {
+    !system(pkg-config QtDeclarative) {
+        HAVE_QT_DECLARATIVE = no
+    }
+}
+
+# QtQuick1 provides QDeclarativeView and QDeclarativeItem
+# On Qt4 it is actually a part of the QtDeclarative module
+HAVE_QT_QUICK1 = yes
+contains(QT_MAJOR_VERSION, 5) {
+    !contains(QT_CONFIG, quick1) {
+        HAVE_QT_QUICK1 = no
+    }
+} else {
+    !contains(HAVE_QT_DECLARATIVE, yes) {
+        HAVE_QT_QUICK1 = no
+    }
+}
+
+# On Qt5, quick or quick1 is required in addition to declarative for "QT" option
+# On Qt4, it should only contain declarative
+contains(QT_MAJOR_VERSION, 5) {
+    QT_DECLARATIVE = declarative quick
+    contains(HAVE_QT_QUICK1, yes) {
+        QT_DECLARATIVE += quick1
+    }
+} else {
+    QT_DECLARATIVE = declarative
+}
+
+contains(HAVE_QT_DECLARATIVE, no) {
     !build_pass:system(echo "QtDeclarative not found - no QML support")
-    HAVE_QT_DECLARATIVE = no
 }
 
 HAVE_PYSIDE = yes



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]