diff --git a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri index 701d8c61d5d82c9c356b6f41b12741fc81686f86..aa172906eb6da44372d1620c13740a0e5cc97ad6 100644 --- a/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri +++ b/share/qtcreator/templates/qmlapp/qmlapplicationviewer/qmlapplicationviewer.pri @@ -10,16 +10,45 @@ INCLUDEPATH += $$PWD contains(DEFINES, QMLOBSERVER) { DEFINES *= QMLJSDEBUGGER } + +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) +} + contains(DEFINES, QMLJSDEBUGGER) { CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + + error("Qt version $$QT_VERSION too old for QmlJS Debugging. Aborting.") + } isEmpty(QMLJSDEBUGGER_PATH) { warning() - warning(Debugging QML requires the qmljsdebugger library that ships with Qt Creator.) - warning(Please specify its location on the qmake command line, e.g.) - warning( qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qml/qmljsdebugger) + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") warning() - error(QMLJSDEBUGGER defined, but no QMLJSDEBUGGER_PATH set on command line. Aborting.) + error("QMLJSDEBUGGER defined, but no QMLJSDEBUGGER_PATH set on command line. Aborting.") DEFINES -= QMLJSDEBUGGER } else { include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)