diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-01-29 15:34:03 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-01-29 14:41:40 +0000 |
commit | 957007a9493a41064dcb83155e31ce52021db077 (patch) | |
tree | da4ccbfe5bba275bb09cda09a7fada0914425456 | |
parent | a6ccef651ddc075cf205bbd2693a26c08de6817a (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>
-rwxr-xr-x | util/cmake/pro2cmake.py | 11 |
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}" |