7
The qmake build is split into three different file types:
9
* .pro files: These files represent top level targets that can be
10
built individually, or a collection of sub-targets used for
11
organizing the project.
13
* .pri files: These files are included from top level targets,
14
and represent 'implementation details' of how the target is built.
16
* .prf files: These files take care of generic build rules
17
that applies to all targets, or specific 'features' that can
20
The first two file types are spread throughout the source tree, while
21
the .prf files are located in 'Tools/qmake/mkspecs/features' and will
22
get loaded by qmake based on setting the QMAKEPATH environment variable.
28
The root project file 'WebKit.pro' is handy both for loading WebKit
29
in Qt Creator, and for building QtWebKit. Normally you will build
30
using build-webkit, but you can also run qmake directly on the root
31
project file. Just make sure to set QMAKEPATH first, so that the
32
custom mkspecs are picked up.
37
Feature files (.prf files) are used in the following ways:
39
1. Every time qmake parses a project file, it will first load
40
a special feature file called 'defaults_pre.prf', then parse
41
the project file, and then load another special feature file
42
called 'defaults_post.prf'. We use these special files to set
43
default options that all project files use, expose a few handy
44
functions, and to post-process the build config based on what
47
2. Dependencies on other targets (libraries) are declared by
48
using CONFIG+=othertarget. This will add the correct include
49
paths and linker options to use the library.
51
3. Optional features can be enabled by passing CONFIG+=foo on
52
the command line when running qmake on the root project file,
53
(or by passing --make-args="CONFIG+=foo" to build-webkit). For
54
example 'CONFIG+=valgrind'.
60
Some targets (JavaScriptCore, WebCore, etc) rely on generated files,
61
(aka. derived sources). These must be generated before the real target
62
is built. This is achieved by splitting the target up into two sub-
63
projects, one for the derived sources and one for the real target,
64
and telling qmake to build them in order using CONFIG += ordered.
70
The custom qmake variable 'WEBKIT' is used for signaling that a
71
target depends in some way on other subproject of the WebKit
72
project. For now this is limited to the set of intermediate
73
libraries: wtf, javascriptcore, webcore, and webkit2.
75
Adding a dependency results in additional include paths being
76
available, and potentially linking to the library. This is
77
decided by the build system based on conditions such as what
78
kind of target is being built and the general build config.