summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt6CoreMacros.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-08-04 16:18:44 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-06 22:00:01 +0000
commited1af43c3b2fcd533d648b4117154c8eb7f2452e (patch)
tree6e50b6edb5e92f1d6d91426f9194f7b20cbd8a93 /src/corelib/Qt6CoreMacros.cmake
parenta2fddbf05a1ba769f7e67d2e36ccad7b262a9950 (diff)
CMake: Rename qt6_add_plugin TYPE option to PLUGIN_TYPE
The intention is to remove TYPE as a keyword completely before 6.2.0 release, but in case if that's not possible due to the large amount of repositories and examples, just print a deprecation warning for now and handle both TYPE and PLUGIN_TYPE. Task-number: QTBUG-95170 Change-Id: If0c18345483b9254b0fc21120229fcc2a2fbfbf5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit b2f00dfb46af633b00946cb1ebfe963964f803ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib/Qt6CoreMacros.cmake')
-rw-r--r--src/corelib/Qt6CoreMacros.cmake22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 882863c5cb..f5a0b22e86 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -1770,7 +1770,11 @@ macro(_qt_internal_get_add_plugin_keywords option_args single_args multi_args)
SHARED
)
set(${single_args}
+ # TODO: For backward compatibility / transitional use only, remove once all repos no longer
+ # use it
TYPE
+
+ PLUGIN_TYPE
CLASS_NAME
OUTPUT_NAME
)
@@ -1800,6 +1804,20 @@ function(qt6_add_plugin target)
unset(arg_CLASSNAME)
endif()
+ # Handle the inconsistent TYPE/PLUGIN_TYPE keyword naming between commands
+ if(arg_TYPE)
+ if(arg_PLUGIN_TYPE AND NOT arg_TYPE STREQUAL arg_PLUGIN_TYPE)
+ message(FATAL_ERROR
+ "Both TYPE and PLUGIN_TYPE were given and were different. "
+ "Only one of the two should be used."
+ )
+ endif()
+ message(AUTHOR_WARNING
+ "The TYPE keyword is deprecated and will be removed soon. Please use PLUGIN_TYPE instead.")
+ set(arg_PLUGIN_TYPE "${arg_TYPE}")
+ unset(arg_TYPE)
+ endif()
+
if(arg_STATIC AND arg_SHARED)
message(FATAL_ERROR
"Both STATIC and SHARED options were given. Only one of the two should be used."
@@ -1844,13 +1862,13 @@ function(qt6_add_plugin target)
if (ANDROID)
set_target_properties(${target}
PROPERTIES
- LIBRARY_OUTPUT_NAME "plugins_${arg_TYPE}_${output_name}"
+ LIBRARY_OUTPUT_NAME "plugins_${arg_PLUGIN_TYPE}_${output_name}"
)
endif()
# Derive the class name from the target name if it's not explicitly specified.
set(plugin_class_name "")
- if (NOT "${arg_TYPE}" STREQUAL "qml_plugin")
+ if (NOT "${arg_PLUGIN_TYPE}" STREQUAL "qml_plugin")
if (NOT arg_CLASS_NAME)
set(plugin_class_name "${target}")
else()