summaryrefslogtreecommitdiffstats
path: root/util/cmake/pro2cmake.py
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-01-29 15:34:03 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-01-29 14:41:40 +0000
commit957007a9493a41064dcb83155e31ce52021db077 (patch)
treeda4ccbfe5bba275bb09cda09a7fada0914425456 /util/cmake/pro2cmake.py
parenta6ccef651ddc075cf205bbd2693a26c08de6817a (diff)
pro2cmake: Handle QML_IMPORT_MAJOR_VERSION and minor variants
This is needed for qtdeclarative examples, otherwise CMake configuration fails due to missing QML import version info. Change-Id: Iedde7b6a9e2d5ac7f6d81969ac7d6d874361c02e Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util/cmake/pro2cmake.py')
-rwxr-xr-xutil/cmake/pro2cmake.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 627a0402d8..f6017880c2 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -3523,6 +3523,17 @@ def handle_app_or_lib(
import_version = scope.get_string("IMPORT_VERSION")
if not import_version:
import_version = scope.get_string("QML_IMPORT_VERSION")
+ if not import_version:
+ import_major_version = scope.get_string("QML_IMPORT_MAJOR_VERSION")
+ import_minor_version = scope.get_string("QML_IMPORT_MINOR_VERSION")
+
+ if not import_major_version and not import_minor_version:
+ raise RuntimeError(f"No QML_IMPORT_VERSION info found for target {target}.")
+
+ if not import_minor_version:
+ import_minor_version = 0
+ import_version = f"{import_major_version}.{import_minor_version}"
+
if import_version:
import_version = import_version.replace(
"$$QT_MINOR_VERSION", "${CMAKE_PROJECT_VERSION_MINOR}"