diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2020-04-28 14:07:29 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2020-04-30 17:44:21 +0000 |
commit | cacac863e7bb5d6751f36ad2a2a3db0fe6774167 (patch) | |
tree | 0cd931f05299b67d47ffb12f5a4efb880f048601 /src/corelib/Qt6CoreMacros.cmake | |
parent | 6ffe9b1c42267eaf0fc81d16931e1a6f9f39879d (diff) |
Set QT_PLUGIN_CLASS_NAME also on public plugins
... and update handling of CLASS_NAME in qt_internal_add_plugin
Change-Id: Iec8e5f9f80df02c9ba21648535872988839f4b64
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/corelib/Qt6CoreMacros.cmake')
-rw-r--r-- | src/corelib/Qt6CoreMacros.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 2e7022c116..d3e13fffa9 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -1140,6 +1140,7 @@ function(qt6_add_plugin target) cmake_parse_arguments(arg "STATIC" "OUTPUT_NAME" + "CLASS_NAME" "" ${ARGN} ) @@ -1168,6 +1169,15 @@ function(qt6_add_plugin target) ) endif() + # Derive the class name from the target name if it's not explicitly specified. + set(plugin_class_name "") + if (NOT arg_CLASS_NAME) + set(plugin_class_name "${target}") + else() + set(plugin_class_name "${arg_CLASS_NAME}") + endif() + set_target_properties(${target} PROPERTIES QT_PLUGIN_CLASS_NAME "${plugin_class_name}") + set(static_plugin_define "") if (arg_STATIC) set(static_plugin_define "QT_STATICPLUGIN") |