diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2020-12-28 10:17:35 +0100 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-01-04 16:45:30 +0100 |
commit | 14d80c3ec4b55e3861156b37da239a87b4f328bf (patch) | |
tree | 06f931a16da77f9ef58820ee7b047d7cd874d371 /src/qml/Qt6QmlMacros.cmake | |
parent | 7c648280bb53c4276ba4ae2abf26d070fedde71a (diff) |
CMake: Make error in defer qmldir file generation more verbose
When CMake version >=3.19 is used, qmldir file for qml module
is generated using DEFER CMake call. If find_package of Qml
component was not explicitly called error message is not really obvious.
Add explicit fatal error for this case and point to possible solution.
Fixes: QTBUG-89622
Change-Id: I82fee717478461762deb2d66a1bc347680b48d06
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index d59f1a6a8f..3935ca8cb1 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -1208,6 +1208,11 @@ function(_qt_internal_qmldir_defer_file command filepath content) file(${ARGV}) else() if("${command}" STREQUAL "WRITE") + if("${__qt_qml_macros_module_base_dir}" STREQUAL "") + message(FATAL_ERROR "Unable to configure qml module. + \"find_package(Qt\${QT_VERSION_MAJOR} CONFIG COMPONENTS Qml)\" \ +is missing.") + endif() # Wrap with EVAL CODE to evaluate and expand arguments cmake_language(EVAL CODE "cmake_language(DEFER DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\" CALL |