diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2022-01-25 21:30:41 +0100 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2022-01-27 11:29:49 +0100 |
commit | f90aba4a53d7b30a963154e01010e683c9e6a869 (patch) | |
tree | 34bad8dc7595ce7630ae16dc0e9a8e9e1ff5fdad | |
parent | be3f352c3391421d7e4836b23568b7ee85a425cd (diff) |
qmltc: Rename CMake command's argument FILES -> QML_FILES
This way we make it consistent with qt_add_qml_module()
Fixes: QTBUG-100214
Change-Id: I9f38a8ba3dec978ccdf4ea937ff662ae2449e582
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 97123dbe6755a787e93797f717f8ebf193352b85)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | src/qml/Qt6QmlBuildInternals.cmake | 2 | ||||
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 6 | ||||
-rw-r--r-- | src/qml/doc/snippets/qmltc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/qml/doc/src/cmake/qt_target_compile_qml_to_cpp.qdoc | 12 | ||||
-rw-r--r-- | tests/auto/qml/qmltc/CMakeLists.txt | 4 |
5 files changed, 13 insertions, 13 deletions
diff --git a/src/qml/Qt6QmlBuildInternals.cmake b/src/qml/Qt6QmlBuildInternals.cmake index 4f2e4de485..c7bb060997 100644 --- a/src/qml/Qt6QmlBuildInternals.cmake +++ b/src/qml/Qt6QmlBuildInternals.cmake @@ -442,7 +442,7 @@ endfunction() function(qt_internal_target_compile_qml_to_cpp target) set(option_args "") set(single_args NAMESPACE) - set(multi_args FILES IMPORT_PATHS) + set(multi_args QML_FILES IMPORT_PATHS) qt_parse_all_arguments(arg "qt_internal_target_compile_qml_to_cpp" "${option_args}" "${single_args}" diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index d9bbf246c8..5b3e3cb005 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -1028,7 +1028,7 @@ endfunction() function(qt6_target_compile_qml_to_cpp target) set(args_option "") set(args_single NAMESPACE) - set(args_multi FILES IMPORT_PATHS) + set(args_multi QML_FILES IMPORT_PATHS) cmake_parse_arguments(PARSE_ARGV 1 arg "${args_option}" "${args_single}" "${args_multi}" @@ -1037,7 +1037,7 @@ function(qt6_target_compile_qml_to_cpp target) message(FATAL_ERROR "Unknown/unexpected arguments: ${arg_UNPARSED_ARGUMENTS}") endif() - if (NOT arg_FILES) + if (NOT arg_QML_FILES) message(FATAL_ERROR "FILES option not given or contains empty list for target ${target}") endif() @@ -1111,7 +1111,7 @@ function(qt6_target_compile_qml_to_cpp target) endif() endforeach() - foreach(qml_file_src IN LISTS arg_FILES) + foreach(qml_file_src IN LISTS arg_QML_FILES) if(NOT qml_file_src MATCHES "\\.(qml)$") list(APPEND non_qml_files ${qml_file_src}) continue() diff --git a/src/qml/doc/snippets/qmltc/CMakeLists.txt b/src/qml/doc/snippets/qmltc/CMakeLists.txt index d4ef2d0fc1..c3d8e4ecf3 100644 --- a/src/qml/doc/snippets/qmltc/CMakeLists.txt +++ b/src/qml/doc/snippets/qmltc/CMakeLists.txt @@ -39,7 +39,7 @@ target_link_libraries(${application_name} PRIVATE Qt::QmlPrivate Qt::QuickPrivat # Compile qml files (listed in FILES) to C++ using qmltc and add these files to # the application binary: qt6_target_compile_qml_to_cpp(${application_name} - FILES + QML_FILES myApp.qml MyButton.qml MySlider.qml diff --git a/src/qml/doc/src/cmake/qt_target_compile_qml_to_cpp.qdoc b/src/qml/doc/src/cmake/qt_target_compile_qml_to_cpp.qdoc index 9db99e7ba2..1382597065 100644 --- a/src/qml/doc/src/cmake/qt_target_compile_qml_to_cpp.qdoc +++ b/src/qml/doc/src/cmake/qt_target_compile_qml_to_cpp.qdoc @@ -39,7 +39,7 @@ \badcode qt_target_compile_qml_to_cpp( target - FILES ... + QML_FILES ... [NAMESPACE namespace] [IMPORT_PATHS ...] ) @@ -64,10 +64,10 @@ The \c target specifies the name of the binary that the QML files belong to. In order for the compilation to succeed, the target is expected to be a valid QML module, defined with qt_add_qml_module() command. -\c FILES lists the \c{.qml} files that are going to be compiled into C++. In -most cases, all the target's QML files would be specified in the FILES. This -way, FILES argument is equivalent to QML_FILES argument of the -qt_add_qml_module() command. +\c QML_FILES lists the \c{.qml} files that are going to be compiled into C++. In +most cases, all the target's QML files would be specified in the QML_FILES. This +way, QML_FILES argument of this command is equivalent to QML_FILES argument of +the qt_add_qml_module() command. \c NAMESPACE argument defines a namespace, in which the generated C++ code resides. By default, no namespace is specified for user projects. The code @@ -77,7 +77,7 @@ generated from Qt's own sources is put under a QT_NAMESPACE namespace. specified entries are passed to qmltc and allow to correctly import modules that do not reside under the location specified by QLibraryInfo::QmlImportsPath. -While processing FILES, the following source file properties are respected: +While processing QML_FILES, the following source file properties are respected: \list \li \c{QT_QMLTC_FILE_BASENAME}: use this source file property to specify a non-default .h and .cpp file name, which might be useful to e.g. resolve diff --git a/tests/auto/qml/qmltc/CMakeLists.txt b/tests/auto/qml/qmltc/CMakeLists.txt index 26cb145807..258a330fad 100644 --- a/tests/auto/qml/qmltc/CMakeLists.txt +++ b/tests/auto/qml/qmltc/CMakeLists.txt @@ -115,7 +115,7 @@ target_compile_definitions(tst_qmltc_diskcache PRIVATE ) qt_internal_target_compile_qml_to_cpp(tst_qmltc_diskcache NAMESPACE QmltcTest - FILES + QML_FILES ${qml_sources} ) @@ -140,7 +140,7 @@ target_compile_definitions(tst_qmltc_nodiskcache PRIVATE ) qt_internal_target_compile_qml_to_cpp(tst_qmltc_nodiskcache # NAMESPACE QmltcTest # use QT_NAMESPACE instead - FILES + QML_FILES ${qml_sources} ) |