Project files contain all the information required by
to build your application, library, or plugin. Generally, you use a series of declarations to specify the resources in the project, but support for simple programming constructs enables you to describe different build processes for different platforms and environments.
Project File Elements
The project file format used by
can be used to support both simple and fairly complex build systems. Simple project files use a straightforward declarative style, defining standard variables to indicate the source and header files that are used in the project. Complex projects may use control flow structures to fine-tune the build process.
In a project file, variables are used to hold lists of strings. In the simplest projects, these variables inform
about the configuration options to use, or supply filenames and paths to use in the build process.
looks for certain variables in each project file, and it uses the contents of these to determine what it should write to a Makefile. For example, the lists of values in the
variables are used to tell qmake about header and source files in the same directory as the project file.
Variables can also be used internally to store temporary lists of values, and existing lists of values can be overwritten or extended with new values.
The following snippet illustrates how lists of values are assigned to variables:
HEADERS = mainwindow.h paintwidget.h
The list of values in a variable is extended in the following way:
SOURCES = main.cpp mainwindow.cpp \
CONFIG += console
The first assignment only includes values that are specified on the same line as the
variable. The second assignment splits the values in the
variable across lines by using a backslash (\).
variable is another special variable that qmake uses when generating a Makefile.