2014-04-25 10:58:33 +02:00
|
|
|
TEMPLATE = subdirs
|
2014-04-25 14:58:14 +02:00
|
|
|
SUBDIRS = \
|
|
|
|
sub_app \
|
2014-05-22 10:08:12 +02:00
|
|
|
sub_lib_qmuparser \
|
|
|
|
test/ParserTest
|
2014-04-25 10:58:33 +02:00
|
|
|
|
2014-04-25 14:58:14 +02:00
|
|
|
sub_lib_qmuparser.file = libs/qmuparser/qmuparser.pro
|
2014-05-22 10:08:12 +02:00
|
|
|
sub_parser_tests.file = test/ParserTest/ParserTest.pro
|
|
|
|
sub_parser_tests.depends = sub_lib_qmuparser
|
2014-04-25 10:58:33 +02:00
|
|
|
sub_app.file = app/app.pro
|
2014-04-25 14:58:14 +02:00
|
|
|
sub_app.depends = sub_lib_qmuparser
|
2014-04-25 10:58:33 +02:00
|
|
|
|
2014-05-22 10:08:12 +02:00
|
|
|
|
2014-04-25 10:58:33 +02:00
|
|
|
#This makes it possible to use make -j 4 on your fancy quad-core system with a project that consists of several
|
|
|
|
#components that depend on each other. To simplify the process a bit, the following test function can be defined:
|
|
|
|
|
|
|
|
# addSubdirs(subdirs,deps): Adds directories to the project that depend on
|
|
|
|
# other directories
|
|
|
|
defineTest(addSubdirs) {
|
|
|
|
for(subdirs, 1) {
|
|
|
|
entries = $$files($$subdirs)
|
|
|
|
for(entry, entries) {
|
|
|
|
name = $$replace(entry, [/\\\\], _)
|
|
|
|
SUBDIRS += $$name
|
|
|
|
eval ($${name}.subdir = $$entry)
|
|
|
|
for(dep, 2):eval ($${name}.depends += $$replace(dep, [/\\\\], _))
|
|
|
|
export ($${name}.subdir)
|
|
|
|
export ($${name}.depends)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export (SUBDIRS)
|
|
|
|
}
|
|
|
|
#You can then use it like to define a project that has:
|
|
|
|
|
|
|
|
#several contributed modules that should be compiled first
|
|
|
|
#addSubdirs (contrib/*)
|
|
|
|
|
|
|
|
#a kernel lib for non-gui related stuff that depends on some contrib modules
|
|
|
|
#addSubdirs (src/lib/kernel, contrib/module1 contrib/module2)
|
|
|
|
|
|
|
|
#a gui lib that depends on the kernel lib and some other contrib modules
|
|
|
|
#addSubdirs (src/lib/gui, src/lib/kernel contrib/module3 contrib/module4)
|
|
|
|
|
|
|
|
#test benches for the kernel and gui libs
|
|
|
|
#addSubdirs (src/tests/kernel, src/lib/kernel)
|
|
|
|
#addSubdirs (src/tests/gui, src/lib/gui)
|
|
|
|
|
|
|
|
#a main program that uses the gui and kernel libs
|
|
|
|
#addSubdirs (src/main, src/lib/gui src/lib/kernel)
|
|
|
|
|
|
|
|
#several modules that only depend on the kernel lib
|
|
|
|
#addSubdirs (src/modules/*, src/lib/kernel)
|