summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorJean-Michaël Celerier <jeanmichael.celerier@gmail.com>2019-05-03 16:03:15 +0200
committerJean-Michaël Celerier <jean-michael.celerier@kdab.com>2019-06-04 10:08:07 +0000
commit0900298d466e819dd6d8fd39c0be333dc09af189 (patch)
tree9ced8b95aa4bf26916564426105f841433c73273 /util
parent9e6781b69e19f66cb56b1875c583da4682909a85 (diff)
cmake: register plug-ins, create dependencies file
This commit introduces infrastructure work to allow static builds of Qt to handle importing of plug-ins. Change-Id: Ife0ca3ca7276ea8ec96fe0eb6adf934fad7620ec Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/pro2cmake.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index dfe407da6d..3b37991cba 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -1193,11 +1193,6 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *,
# mark RESOURCES as visited:
scope.get('RESOURCES')
- plugin_type = scope.get_string('PLUGIN_TYPE')
-
- if plugin_type:
- cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type))
-
write_all_source_file_lists(cm_fh, scope, 'SOURCES', indent=indent + 1)
write_source_file_list(cm_fh, scope, 'DBUS_ADAPTOR_SOURCES', ['DBUS_ADAPTORS',], indent + 1)
@@ -1611,6 +1606,10 @@ def write_module(cm_fh: typing.IO[str], scope: Scope, *,
if len(module_config):
extra.append('QMAKE_MODULE_CONFIG {}'.format(" ".join(module_config)))
+ module_plugin_types = scope.get_files('MODULE_PLUGIN_TYPES')
+ if module_plugin_types:
+ extra.append('PLUGIN_TYPES {}'.format(" ".join(module_plugin_types)))
+
write_main_part(cm_fh, module_name[2:], 'Module', 'add_qt_module', scope,
extra_lines=extra, indent=indent,
known_libraries={}, extra_keys=[])
@@ -1726,8 +1725,18 @@ def write_plugin(cm_fh, scope, *, indent: int = 0):
plugin_name = scope.TARGET
assert plugin_name
+ extra = []
+
+ plugin_type = scope.get_string('PLUGIN_TYPE')
+ if plugin_type:
+ extra.append('TYPE {}'.format(plugin_type))
+
+ plugin_class_name = scope.get_string('PLUGIN_CLASS_NAME')
+ if plugin_class_name:
+ extra.append('CLASS_NAME {}'.format(plugin_class_name))
+
write_main_part(cm_fh, plugin_name, 'Plugin', 'add_qt_plugin', scope,
- indent=indent, known_libraries={}, extra_keys=[])
+ indent=indent, extra_lines=extra, known_libraries={}, extra_keys=[])
def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *,