summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-05-28 16:29:17 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-05-29 17:17:18 +0200
commitc4e09cf26790d6d293efd0e389517dcaf7f34d85 (patch)
tree24f08737add2d9ab1e96811043cb7a66cc155a34 /util
parentf77c4ebb7de7df14420729d5d6e002f927c3d9b2 (diff)
CMake: pro2cmake: Check existence of QMLTYPES_INSTALL_DIR
When writing the qt6_qml_type_registration call, make sure to write the set(QT_QML_MODULE_INSTALL_QMLTYPES TRUE) statement only if an explicit path was provided via QMLTYPES_INSTALL_DIR / QT_QML_MODULE_INSTALL_DIR. This will remove the QT_QML_MODULE_INSTALL_QMLTYPES property from many examples and tests in qtdeclarative, thus not installing the .qmltypes file into the Qt prefix, thus polluting it. Task-number: QTBUG-84403 Change-Id: I5c64d42915896d14f2591cbb64d73d912dbf7c7d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/pro2cmake.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 71ef931800..49a3917c77 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -3816,7 +3816,10 @@ def handle_app_or_lib(
# that is not a qml plugin
if "qmltypes" in scope.get("CONFIG") and "qml_plugin" not 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")
+
+ install_dir = scope.expandString("QMLTYPES_INSTALL_DIR")
+ if install_dir:
+ cm_fh.write(f"{spaces(indent+1)}QT_QML_MODULE_INSTALL_QMLTYPES TRUE\n")
import_version = get_qml_import_version(scope, target)
if import_version:
@@ -3834,7 +3837,6 @@ def handle_app_or_lib(
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]", "${INSTALL_QMLDIR}")
cm_fh.write(f'{spaces(indent+1)}QT_QML_MODULE_INSTALL_DIR "{install_dir}"\n')