CMake: Fix NO_LINT option to work properly

Even if NO_LINT was passed to qt_add_qml_module, qt_target_qml_sources
would read the property set by qt_add_qml_module too late, and would
still create a lint target.

Make sure we read the property earlier.

Pick-to: 6.6 6.5
Fixes: QTBUG-121206
Change-Id: I409b37cab6dc0583458142ff00447d4191b4ff61
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3fb693d7da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2024-01-17 17:46:12 +01:00 committed by Qt Cherry-pick Bot
parent 7b439b7e5f
commit 48a5ebd140
1 changed files with 3 additions and 3 deletions

View File

@ -2275,8 +2275,9 @@ function(qt6_target_qml_sources target)
message(FATAL_ERROR "Unknown/unexpected arguments: ${arg_UNPARSED_ARGUMENTS}")
endif()
if (NOT arg_QML_FILES AND NOT arg_RESOURCES)
if(NOT arg_NO_LINT)
get_target_property(no_lint ${target} QT_QML_MODULE_NO_LINT)
if(NOT arg_QML_FILES AND NOT arg_RESOURCES)
if(NOT arg_NO_LINT AND NOT no_lint)
_qt_internal_target_enable_qmllint(${target})
endif()
@ -2295,7 +2296,6 @@ function(qt6_target_qml_sources target)
)
endif()
get_target_property(no_lint ${target} QT_QML_MODULE_NO_LINT)
get_target_property(no_cachegen ${target} QT_QML_MODULE_NO_CACHEGEN)
get_target_property(no_qmldir ${target} QT_QML_MODULE_NO_GENERATE_QMLDIR)
get_target_property(resource_prefix ${target} QT_QML_MODULE_RESOURCE_PREFIX)