summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-04-15 12:12:45 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-15 18:29:38 +0000
commit65d8a285df7788c69889dbf4d5dd69f5145ba86a (patch)
tree83bc6e16a00610e9ab88934974455967d0b2a086
parent2c2cc9ed808ba4ff8cc2595e098c754e22862db7 (diff)
CMake: pro2cmake: Use latest project version for qml import version
Use PROJECT_VERSION instead of CMAKE_PROJECT_VERSION when setting the version of a qml module, which extracts the version of the latest project() call rather than the top-level one. Using CMAKE_PROJECT_VERSION caused issues in top-level builds where the qtdeclarative version is 6.2, but the top-level project version is still 6.1 and hasn't been updated to 6.2, causing qml module import errors. This was probably an oversight during initial implementation of qml support in pro2cmake. So projects that define qml modules should be adapted accordingly. Amends cce8ada8141d786c1deda78fdba485b4c67f9687 Amends 28fff4a5519c8e1068450a052cb19fb2149e9726 Task-number: QTBUG-92861 Change-Id: I494784694e997501a5bc4fd0c0eac458ddc248aa Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit cf27a23937b108f7f8492a7873f71bc71c368dfb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rwxr-xr-xutil/cmake/pro2cmake.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 601947285b..41902f541b 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -4041,8 +4041,8 @@ def get_qml_import_version(scope: Scope, target: str) -> str:
if import_version:
replacements = [
- ("$$QT_MINOR_VERSION", "${CMAKE_PROJECT_VERSION_MINOR}"),
- ("$$QT_VERSION", "${CMAKE_PROJECT_VERSION}"),
+ ("$$QT_MINOR_VERSION", "${PROJECT_VERSION_MINOR}"),
+ ("$$QT_VERSION", "${PROJECT_VERSION}"),
]
for needle, replacement in replacements:
import_version = import_version.replace(needle, replacement)