diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-08-04 16:18:44 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-08-06 21:08:21 +0200 |
commit | b2f00dfb46af633b00946cb1ebfe963964f803ca (patch) | |
tree | 0b52bda2d0e77744c7969c06ce5882c8d7c9cb2d /src/corelib/Qt6CoreMacros.cmake | |
parent | eb4fb9fa32797d48d4779464483230ad92f349a6 (diff) | |
download | qtbase-b2f00dfb46af633b00946cb1ebfe963964f803ca.tar.gz |
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
Pick-to: 6.2
Change-Id: If0c18345483b9254b0fc21120229fcc2a2fbfbf5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/corelib/Qt6CoreMacros.cmake')
-rw-r--r-- | src/corelib/Qt6CoreMacros.cmake | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 622505689a..4c85873f6b 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() |