qmake provides a project-oriented system for managing the buildprocess for applications, libraries, and other components. This approach gives developers control over the source files used, and allows each of the steps in the process to be described concisely, typically within a single file.
qmake expands the information in each project file to a Makefile that executes the necessary commands for compiling and linking.
Describing a Project
Projects are described by the contents of project (
.pro) files. The information within these is used by
qmake to generate a Makefile containing all the commands that are needed to build each project. Project files typically contain a list of source and header files, general configuration information, and any application-specific details, such as a list of extra libraries to link against, or a list of extra include paths to use.
Project files can contain a number of different elements, including comments, variable declarations, built-in functions, and some simple control structures. In most simple projects, it is only necessary to declare the source and header files that are used to build the project with some basic configuration options.
Complete examples of project files can be found in the qmake Tutorial. An introduction to project files can be found in the qmake Project Files chapter, and a more detailed description is available in the qmake Reference.
Building a Project
For simple projects, you only need to run
qmake in the top level directory of your project. By default,
qmake generates a Makefile that you then use to build the project, and you can then run your platform's
make tool to build the project.
Using Precompiled Headers
In large projects, it is possible to take advantage of precompiled header files to speed up the build process. This feature is described in detail in the Using Precompiled Headers chapter.
© 2016 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.