Building
Qt VS Tools includes MSBuild rules and targets specific to Meta-Object Compiler (moc), User Interface Compiler (uic), and Resource Compiler (rcc). These rules are referred to as Qt/MSBuild. They enable running moc, rcc and uic in parallel processes and setting build options, such as selecting project items to process and the tools to process them. Further, source files that the Qt tools generate are added to the C++ compilation during the build process, so you do not need to include generated files in projects.
You can set options for each Qt tool either globally at project level or for specific files. To set global options for handling files at project level:
- Go to Project > Properties > Configuration Properties > Qt Project Settings.
- Go to Properties in the context menu of the project.
To set options for handling a specific file, go to Properties in the context menu of the file. The dialog lists only tools relevant for the file type. For example, moc options are available for C++ source and header files, whereas uic options are available for UI forms (.ui).
Qt/MSBuild project format
The Qt/MSBuild project file format has changed between Qt VS Tools versions. Currently, version 3 and later are supported.
If you open an existing solution that has version 1 project format, you can still build it. If it has version 2 format, you can build it if you set additional command line options and set the default Qt version to the Qt version that you initially created the project for.
When you load .pro files, Qt VS Tools automatically converts custom build steps into Qt/MSBuild steps.
For more information about Qt/MSBuild project format versions, see Qt VS Tools - Project format versions.
Path to build files
To set the path to the Qt/MSBuild files, go to Extensions > Qt VS Tools > Options > Qt/MSBuild.
This corresponds to setting the value of the QTMSBUILDS
environment variable.
See also Build solutions that have Qt/MSBuild format 2, Convert solutions to latest Qt/MSBuild format, and Load Qt projects.
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.