qul_target_qml_sources

Adds QML source files to a target.

概要

qul_target_qml_sources(<target> src_file1 [src_file2 ...]
                       [OUTPUT_DIRECTORY <directory>]
                       [MODULE_URI <uri>]
                       [COPY_QML_FILES])
							

描述

Creates rules for calling the QML to C++ compiler (qmltocpp) on the given source .qml files. For each input file, an output file is generated in a subfolder under the build directory. These generated files are listed as source files of the target.

选项

可以设置 OUTPUT_DIRECTORY explicitly to control where the generated files are placed. If the path is relative, it is relative to the current build directory.

When building a library that provides a QML module, use the optional MODULE_URI parameter to ensure that the generated sources use the appropriate namespace. The uri is a normal dot-separated QML import uri.

设置 COPY_QML_FILES flag for the source .qml files to be copied next to the generated files. This can be useful for building QML modules.

范例

qul_target_qml_sources(example_app Example.qml MyButton.qml)
							
qul_target_qml_sources(example_lib IndicatorBase.qml Style.qml
                       MODULE_URI MyModule.Indicators
                       OUTPUT_DIRECTORY MyModule/Indicators
                       COPY_QML_FILES)
							

Since

This command was introduced in Qt Quick Ultralite 1.0.

另请参阅 qmltocpp .