diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-01 11:01:50 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-02 11:10:48 +0000 |
commit | 693b17076c688aee8de21eb34800d99e6b96c501 (patch) | |
tree | a4710e152a11725882150a50d0c2c72c02ba2cbf /src/qml/Qt6QmlMacros.cmake | |
parent | ab238e839fc10a85a6711c429e883c7e839596f3 (diff) |
CMake: Include upper case .js and .mjs files in qmldir
You can use them as singletons.
Fixes: QTBUG-100326
Change-Id: I8e07600657bd43ba8376279ffe39cfa5d3213c38
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit bf38043b6107cb10bca4be78ecc8bbc20338a61b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index 2033617419..5cfc44c40e 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -1815,17 +1815,16 @@ function(qt6_target_qml_sources target) get_source_file_property(qml_file_typename ${qml_file_src} QT_QML_SOURCE_TYPENAME) if (NOT qml_file_typename) get_filename_component(qml_file_ext ${qml_file_src} EXT) - if (NOT qml_file_ext STREQUAL ".js" AND NOT qml_file_ext STREQUAL ".mjs") - get_filename_component(qml_file_typename ${qml_file_src} NAME_WE) - endif() + get_filename_component(qml_file_typename ${qml_file_src} NAME_WE) endif() # Do not add qmldir entries for lowercase names. Those are not components. if (qml_file_typename AND qml_file_typename MATCHES "^[A-Z]") - if (qml_file_ext AND NOT qml_file_ext STREQUAL ".qml" AND NOT qml_file_ext STREQUAL ".ui.qml") + if (qml_file_ext AND NOT qml_file_ext STREQUAL ".qml" AND NOT qml_file_ext STREQUAL ".ui.qml" + AND NOT qml_file_ext STREQUAL ".js" AND NOT qml_file_ext STREQUAL ".mjs") message(AUTHOR_WARNING - "${qml_file_src} has a file extension different from .qml and .ui.qml. " - "This leads to unexpected component names." + "${qml_file_src} has a file extension different from .qml, .ui.qml, .js, " + "and .mjs. This leads to unexpected component names." ) endif() |