From 957007a9493a41064dcb83155e31ce52021db077 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 29 Jan 2020 15:34:03 +0100 Subject: 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 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'util') 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}" -- cgit v1.2.3