aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlMacros.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-08-25 22:22:31 +1000
committerCraig Scott <craig.scott@qt.io>2021-08-30 17:18:57 +1000
commitd8bc85e79a7b9ea40cc96a53fb6a312dd4b06cb0 (patch)
tree66fe824ca7be1dd1e2fae333bd18fc79a3041d11 /src/qml/Qt6QmlMacros.cmake
parentf554a5b6b87ab4a93893a1827a07746f85504f0c (diff)
Rename source property to QT_QML_SOURCE_VERSIONS
The old name was the singular form, but the property accepts a list of versions, so plural form is more appropriate. Still support the old singular name with an author warning, since it was part of tech preview and some code might be using it. Pick-to: 6.2 Change-Id: I2dbd9b1809bae6f608b222577b2f37a7dc94805d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r--src/qml/Qt6QmlMacros.cmake22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index cf6cca0e38..cc58b77240 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -1480,8 +1480,26 @@ function(qt6_target_qml_sources target)
# Do not add qmldir entries for lowercase names. Those are not components.
if (qml_file_typename MATCHES "^[A-Z]")
- # TODO: rename to QT_QML_SOURCE_VERSIONS
- get_source_file_property(qml_file_versions ${qml_file_src} QT_QML_SOURCE_VERSION)
+ # We previously accepted the singular form of this property name
+ # during tech preview. Issue a warning for that, but still
+ # honor it. The plural form will override it if both are set.
+ get_property(have_singular_property SOURCE ${qml_file_src}
+ PROPERTY QT_QML_SOURCE_VERSION SET
+ )
+ if(have_singular_property)
+ message(AUTHOR_WARNING
+ "The QT_QML_SOURCE_VERSION source file property has been replaced "
+ "by QT_QML_SOURCE_VERSIONS (i.e. plural rather than singular). "
+ "The singular form will eventually be removed, please update "
+ "the project to use the plural form instead for the file at:\n"
+ " ${qml_file_src}"
+ )
+ endif()
+ get_source_file_property(qml_file_versions ${qml_file_src} QT_QML_SOURCE_VERSIONS)
+ if(NOT qml_file_versions AND have_singular_property)
+ get_source_file_property(qml_file_versions ${qml_file_src} QT_QML_SOURCE_VERSION)
+ endif()
+
get_source_file_property(qml_file_singleton ${qml_file_src} QT_QML_SINGLETON_TYPE)
get_source_file_property(qml_file_internal ${qml_file_src} QT_QML_INTERNAL_TYPE)