consistency++
[quassel.git] / build / quassel.pro
1 # This project file can be used to set up a build environment for quassel.
2 # To build the default configuration (i.e. qtgui, core and monolithic client),
3 # simply run
4 #
5 # > qmake && make
6 #
7 # in this directory. In order to select the binaries to build, you may set
8 # the BUILD variable as follows:
9 #
10 # > qmake BUILD=<mode> && make
11 #
12 # where <mode> is a quoted string that may contain any of 'qtgui', 'core', 'mono' or 'all'.
13 #
14 # NOTE: To change the build configuration, you have to run 'make distclean' first!
15
16 TEMPLATE = subdirs
17
18 TARGETS = qtclient core mono
19
20 # Check build configuration
21 isEmpty(BUILD): BUILD = all  # build everything by default
22 contains(BUILD, all): BUILD = $${TARGETS}
23
24 # Find modules and targets to build
25 for(target, TARGETS): contains(BUILD, $$target) {
26   include(targets/$${target}.pri)
27   BUILD_MODS *= $${MODULES}
28   BUILD_TARGETS *= $$target
29 }
30
31 # Now add modules and their deps
32 for(mod, BUILD_MODS) {
33   include(../src/$${mod}/$${mod}.pri)
34   SUBDIRS += mod_$${mod}
35   eval(mod_$${mod}.file = modules/$${mod}.pro)
36   eval(mod_$${mod}.makefile = Makefile.mod_$${mod})  # This prevents distclean from removing our Makefile -_-
37   for(dep, DEPMOD): eval(mod_$${mod}.depends += mod_$${dep})
38   export(mod_$${mod}.file)
39   export(mod_$${mod}.makefile)
40   export(mod_$${mod}.depends)
41 }
42
43 # Same with targets
44 for(target, BUILD_TARGETS) {
45   include(targets/$${target}.pri)
46   SUBDIRS += $${target}
47   eval($${target}.file = targets/$${target}.pro)
48   eval($${target}.makefile = Makefile.target_$${target})
49   for(mod, MODULES): eval($${target}.depends += mod_$${mod})
50   export($${target}.file)
51   export($${target}.makefile)
52   export($${target}.depends)
53 }
54