summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-10-10 14:21:02 +0200
committerLeander Beernaert <leander.beernaert@qt.io>2019-10-10 13:06:51 +0000
commitb42feb02ceebfcf86caf8c8aa8be3e84b8e431ca (patch)
tree36e0e5c049f6dee42095d587d0f609ed70597f5d /util
parentfbf27595984f79787588bf4c59217ae6707313a3 (diff)
Add install directory for plugins without type
When we run into a plugin that does not have a type and is not a qml plugin, we try to see if we can find the target installation path and provide INSTALL_DIRECTORY AND ARCHIVE_INSTALL_DIRECTORY to the add_qt_plugin call. We run into this frequently with the unit tests. This patch also changes add_qt_plugin() to use the value provided in INSTALL_DIRECTORY for ARCHIVE_INSTALL_DIRECTORY if no value is provided for the latter. Change-Id: I61278904a4d2d72308079cd362bd085b4e2f540c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/pro2cmake.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 6e9f53aa3f..211678a886 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -3106,6 +3106,11 @@ def write_plugin(cm_fh, scope, *, indent: int = 0) -> str:
elif is_qml_plugin:
plugin_function_name = "add_qml_module"
qmldir = write_qml_plugin(cm_fh, plugin_name, scope, indent=indent, extra_lines=extra)
+ else:
+ target_path = scope.expandString('target.path')
+ target_path = replace_path_constants(target_path, scope)
+ if target_path:
+ extra.append(f'INSTALL_DIRECTORY "{target_path}"')
plugin_class_name = scope.get_string("PLUGIN_CLASS_NAME")
if plugin_class_name: