CMake: Store unsanitized plugin type names in module .json files

The module information .json gained a "plugin_types" key in 6.5.0.
Unfortunately, this contained the "sanitized" version of plugin types,
meaning dashes converted to underscores. For plugin types that contain
dashes, e.g. wayland-decoration-client, the file contained
wayland_decoration_client, which doesn't match its plugin directory
name.

Since "unsanitizing" plugin names is hard and "sanitizing" is easy, we
now store the unsanitized plugin names and burden the consumer of the
module .json files with the sanitation task.

[ChangeLog][CMake] The module information JSON files now contain the
unsanitized plugin types of a module, e.g. wayland-decoration-client
instead of wayland_decoration_client. Consumers of the module
information file must sanitize plugin types themselves if necessary.

Pick-to: 6.5
Fixes: QTBUG-112872
Change-Id: I09cc9406b360779087086707abee3d5219a24452
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2023-04-14 15:23:05 +02:00
parent ffdfafc4b4
commit 24fe86ebe7

View File

@ -1076,7 +1076,7 @@ function(qt_describe_module target)
get_target_property(target_type ${target} TYPE)
if(NOT target_type STREQUAL "INTERFACE_LIBRARY")
get_target_property(plugin_types ${target} MODULE_PLUGIN_TYPES)
get_target_property(plugin_types ${target} QMAKE_MODULE_PLUGIN_TYPES)
if(plugin_types)
qt_internal_list_to_json_array(plugin_types plugin_types)
string(APPEND extra_module_information "\n \"plugin_types\": ${plugin_types},")