OSDN Git Service

QmlDesigner: Improve Qt version check in plugins.pro
authorKai Koehne <kai.koehne@nokia.com>
Wed, 29 Sep 2010 11:35:06 +0000 (13:35 +0200)
committerKai Koehne <kai.koehne@nokia.com>
Wed, 29 Sep 2010 14:44:52 +0000 (16:44 +0200)
Reviewed-by: Thomas Hartmann
qtcreator.pri
src/plugins/plugins.pro

index 8b2268c..2994770 100644 (file)
@@ -31,6 +31,26 @@ defineReplace(qtLibraryName) {
    return($$RET)
 }
 
+defineTest(minQtVersion) {
+    maj = $$1
+    min = $$2
+    patch = $$3
+    isEqual(QT_MAJOR_VERSION, $$maj) {
+        isEqual(QT_MINOR_VERSION, $$min) {
+            isEqual(QT_PATCH_VERSION, $$patch) {
+                return(true)
+            }
+            greaterThan(QT_PATCH_VERSION, $$patch) {
+                return(true)
+            }
+        }
+        greaterThan(QT_MINOR_VERSION, $$min) {
+            return(true)
+        }
+    }
+    return(false)
+}
+
 # For use in custom compilers which just copy files
 win32:i_flag = i
 defineReplace(stripSrcDir) {
index 9702fb7..570be94 100644 (file)
@@ -38,20 +38,22 @@ SUBDIRS   = plugin_coreplugin \
             plugin_tasklist \
             debugger/dumper.pro
 
-contains(QT_CONFIG, declarative) {
+include(../../qtcreator.pri)
 
+contains(QT_CONFIG, declarative) {
     SUBDIRS += \
             plugin_qmlprojectmanager \
             plugin_qmljsinspector
 
     include(../private_headers.pri)
     exists($${QT_PRIVATE_HEADERS}/QtDeclarative/private/qdeclarativecontext_p.h) {
-        isEqual(QT_MINOR_VERSION, 7):greaterThan(QT_PATCH_VERSION, 0) {
+
+        minQtVersion(4, 7, 1) {
             SUBDIRS += plugin_qmldesigner 
         } else {
             warning()
             warning("QmlDesigner plugin has been disabled.")
-            warning("Qt Version has to be 4.7.x with x > 0")
+            warning("QmlDesigner requires Qt 4.7.1 or later.")
         }
     } else {
         warning()