qbs build: Use the proper way to check the Qt version

Doing this via the product condition silently switches the product off
if Qt is too old, which will leave users wondering about the reason.
Instead, use the long-supported version check functionality of the
Depends item, which will result in a clear message in case of a failure.
Also, move the check to QtcProduct. The version requirement is for all
of QtCreator, not just the plugins.

Change-Id: Id445823e0243f5ad3b7a0ccb747a90e4fb18889b
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
Christian Kandeler
2017-11-29 17:43:02 +01:00
parent 19d93d29a9
commit b98d5822f5
2 changed files with 1 additions and 5 deletions

View File

@@ -12,9 +12,6 @@ QtcProduct {
property var pluginRecommends: [] property var pluginRecommends: []
property var pluginTestDepends: [] property var pluginTestDepends: []
property string minimumQtVersion: "5.6.2"
condition: QtcFunctions.versionIsAtLeast(Qt.core.version, minimumQtVersion)
targetName: QtcFunctions.qtLibraryName(qbs, name) targetName: QtcFunctions.qtLibraryName(qbs, name)
destinationDirectory: qtc.ide_plugin_path destinationDirectory: qtc.ide_plugin_path

View File

@@ -20,6 +20,7 @@ Product {
Depends { name: "cpp" } Depends { name: "cpp" }
Depends { name: "qtc" } Depends { name: "qtc" }
Depends { name: product.name + " dev headers"; required: false } Depends { name: product.name + " dev headers"; required: false }
Depends { name: "Qt.core"; versionAtLeast: "5.6.2" }
Properties { Properties {
condition: Utilities.versionCompare(Qt.core.version, "5.7") < 0 condition: Utilities.versionCompare(Qt.core.version, "5.7") < 0
@@ -36,8 +37,6 @@ Product {
cpp.useCxxPrecompiledHeader: useNonGuiPchFile || useGuiPchFile cpp.useCxxPrecompiledHeader: useNonGuiPchFile || useGuiPchFile
cpp.visibility: "minimal" cpp.visibility: "minimal"
Depends { name: "Qt.core" }
Group { Group {
fileTagsFilter: installTags fileTagsFilter: installTags
qbs.install: install qbs.install: install