diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-01-24 14:04:15 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-01-27 11:49:25 +0000 |
commit | 604aa83ad910c3a17af33850312d3c61a59f558f (patch) | |
tree | 86962ebf60e84e93beec92bd15c50109eb63136a /util/cmake/pro2cmake.py | |
parent | f67d8ae2d4339c50cf0a4ca26f25c3afebc128ea (diff) |
Reformat pro2cmake
Change-Id: I97175e8edbd4b911397f5b03a646006eff32a5bc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'util/cmake/pro2cmake.py')
-rwxr-xr-x | util/cmake/pro2cmake.py | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 24dfd0ca8b..ed74a50b66 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -3519,35 +3519,33 @@ def handle_app_or_lib( # Generate qmltypes instruction for anything that may have CONFIG += qmltypes # that is not a qml plugin if "qmltypes" in scope.get("CONFIG") and not "qml_plugin" in scope.get("_LOADED"): - cm_fh.write(f"\n{spaces(indent)}set_target_properties({target} PROPERTIES\n") - cm_fh.write(f"{spaces(indent+1)}QT_QML_MODULE_INSTALL_QMLTYPES TRUE\n") - - import_version = scope.get_string("IMPORT_VERSION") - if not import_version: - import_version = scope.get_string("QML_IMPORT_VERSION") - if import_version: - import_version = import_version.replace( - "$$QT_MINOR_VERSION", "${CMAKE_PROJECT_VERSION_MINOR}" - ) - cm_fh.write(f"{spaces(indent+1)}QT_QML_MODULE_VERSION {import_version}\n") + cm_fh.write(f"\n{spaces(indent)}set_target_properties({target} PROPERTIES\n") + cm_fh.write(f"{spaces(indent+1)}QT_QML_MODULE_INSTALL_QMLTYPES TRUE\n") + + import_version = scope.get_string("IMPORT_VERSION") + if not import_version: + import_version = scope.get_string("QML_IMPORT_VERSION") + if import_version: + import_version = import_version.replace( + "$$QT_MINOR_VERSION", "${CMAKE_PROJECT_VERSION_MINOR}" + ) + cm_fh.write(f"{spaces(indent+1)}QT_QML_MODULE_VERSION {import_version}\n") - import_name = scope.expandString("QML_IMPORT_NAME") - if import_name: - cm_fh.write(f"{spaces(indent+1)}QT_QML_MODULE_URI {import_name}\n") + import_name = scope.expandString("QML_IMPORT_NAME") + if import_name: + cm_fh.write(f"{spaces(indent+1)}QT_QML_MODULE_URI {import_name}\n") - target_path = scope.get("TARGETPATH") - if target_path: - cm_fh.write(f"{spaces(indent+1)}QT_QML_MODULE_TARGET_PATH {target_path}\n") + target_path = scope.get("TARGETPATH") + if target_path: + cm_fh.write(f"{spaces(indent+1)}QT_QML_MODULE_TARGET_PATH {target_path}\n") - install_dir = scope.expandString("QMLTYPES_INSTALL_DIR") - if install_dir: - install_dir = install_dir.replace( - "$$[QT_INSTALL_QML]","${Qt6_DIR}/../../../qml" - ) - cm_fh.write(f"{spaces(indent+1)}QT_QML_MODULE_INSTALL_DIR \"{install_dir}\"\n") + install_dir = scope.expandString("QMLTYPES_INSTALL_DIR") + if install_dir: + install_dir = install_dir.replace("$$[QT_INSTALL_QML]", "${Qt6_DIR}/../../../qml") + cm_fh.write(f'{spaces(indent+1)}QT_QML_MODULE_INSTALL_DIR "{install_dir}"\n') - cm_fh.write(f"{spaces(indent)})\n\n") - cm_fh.write(f"qt6_qml_type_registration({target})\n") + cm_fh.write(f"{spaces(indent)})\n\n") + cm_fh.write(f"qt6_qml_type_registration({target})\n") def handle_top_level_repo_project(scope: Scope, cm_fh: IO[str]): |