summaryrefslogtreecommitdiffstats
path: root/util/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-04-15 12:12:45 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2021-04-15 13:27:23 +0200
commitcf27a23937b108f7f8492a7873f71bc71c368dfb (patch)
tree163fb7c53931f4827be9303655e49c8409ea6daa /util/cmake
parente7bdf7273c7463f2884ddf8e6b733f2cb5134d72 (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 Pick-to: 6.1 6.0 Task-number: QTBUG-92861 Change-Id: I494784694e997501a5bc4fd0c0eac458ddc248aa Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'util/cmake')
-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 6f4f741c1a..f17248bf01 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)