diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-08-20 17:55:03 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-08-23 11:05:15 +0200 |
commit | 550623a8eff6cf9422caa75b9e30111821941aac (patch) | |
tree | 06e355279a70e601dc80d1f2a1f5854da5449cd3 /util | |
parent | f9efe046a7d706ac41cd37298d577371708a9add (diff) |
pro2cmake.py: support multiple versions in QT_QML_SOURCE_VERSION
Task-number: QTBUG-86174
Change-Id: I56f4a54874410a19f782ce4dda2e166789570fb9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-x | util/cmake/pro2cmake.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index a01795a833..3bd6b8c8d8 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -571,7 +571,7 @@ def write_add_qt_resource_call( class QmlDirFileInfo: def __init__(self, file_path: str, type_name: str) -> None: self.file_path = file_path - self.version = "" + self.versions = "" self.type_name = type_name self.internal = False self.singleton = False @@ -610,7 +610,7 @@ class QmlDir: file_info = self.type_names[key] string += ( f" type:{file_info.type_name} " - f"version:{file_info.version} " + f"versions:{file_info.versions} " f"path:{file_info.file_path} " f"internal:{file_info.internal} " f"singleton:{file_info.singleton}\n" @@ -635,7 +635,11 @@ class QmlDir: def handle_file(self, type_name: str, version: str, path: str) -> QmlDirFileInfo: qmldir_file = self.get_or_create_file_info(path, type_name) - qmldir_file.version = version + # If this is not the first version we've found, + # append ';' to delineate the next version; e.g.: "2.0;2.6" + if qmldir_file.versions: + qmldir_file.versions += ";" + qmldir_file.versions += version qmldir_file.type_name = type_name qmldir_file.path = path return qmldir_file @@ -3980,7 +3984,7 @@ def write_qml_plugin_epilogue( if qml_file in qmldir.type_names: qmldir_file_info = qmldir.type_names[qml_file] cm_fh.write(f"{indent_0}set_source_files_properties({qml_file} PROPERTIES\n") - cm_fh.write(f'{indent_1}QT_QML_SOURCE_VERSION "{qmldir_file_info.version}"\n') + cm_fh.write(f'{indent_1}QT_QML_SOURCE_VERSION "{qmldir_file_info.versions}"\n') # Only write typename if they are different, CMake will infer # the name by default if ( |