C
qmlprojectexporter
Description
Use the qmlprojectexporter to export the QML sources, image assets and fonts into compilable c++ code. It parses a .qmlproject
file listing the assets with exporting options, and converts them. In addition, qmlprojectexporter also exports plaintext lists of the imported and exported files, for convenient automatic use by a 3rd party build system, such as CMake.
Usage of qmlprojectexporter in a CMake project
Using qmlprojectexporter with a CMake build system is straightforward and the Qul CMake macro qul_add_target already takes care of calling qmlprojectexporter with the right parameters, and it requires defining the "QML_PROJECT" argument followed by a qmlproject file as shown next.
qul_add_target(my_project QML_PROJECT my_project.qmlproject)
When using qmlprojectexporter, the following CMake macros are not needed as they are handled by the qmlprojectexporter call.
- qul_target_qml_sources
- qul_target_generate_interfaces
- qul_target_embed_translations
- qul_add_qml_module
Also setting the following target properties from CMake is not required
- QUL_FONT_FILES
Note for a working Qul application with CMake it is still required to call app_target_setup_os and app_target_default_entrypoint macros after adding the qmlproject target as shown next.
app_target_setup_os(myproject) // With a Main.qml (specified only as Main) being the entrypoint app_target_default_entrypoint(swipe_game_qmlproject Main)
Using standalone qmlprojectexporter
When using a build system other than CMake it is still possible to use qmlprojectexporter directly. And afterwards, handling the generated assets files with a build system of choice.
qmlprojectexporter --outdir output_directory myproject.qmlproject
Note: Look at the QmlProject reference for the extended list of qmlprojectexporter commandline options
Since
This executable was introduced in QmlProject API 1.3.
Available under certain Qt licenses.
Find out more.