summaryrefslogtreecommitdiffstats
path: root/src/tools/tools.pro
blob: 32b920c2336fe91cd30f1d3787f1c6c9b1597802 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
TEMPLATE = subdirs

TOOLS_SUBDIRS = src_tools_bootstrap src_tools_moc src_tools_rcc
!contains(QT_CONFIG, no-gui): TOOLS_SUBDIRS += src_tools_uic
!cross_compile {
    contains(QT_CONFIG, qt3support): SRC_SUBDIRS += src_tools_uic3
    win32:!wince*:!win32-g++*: SRC_SUBDIRS += src_tools_idc
}

# Set subdir and respective target name
src_tools_bootstrap.subdir = $$QT_SOURCE_TREE/src/tools/bootstrap
src_tools_bootstrap.target = sub-tools-bootstrap
src_tools_moc.subdir = $$QT_SOURCE_TREE/src/tools/moc
src_tools_moc.target = sub-moc
src_tools_rcc.subdir = $$QT_SOURCE_TREE/src/tools/rcc
src_tools_rcc.target = sub-rcc
src_tools_uic.subdir = $$QT_SOURCE_TREE/src/tools/uic
src_tools_uic.target = sub-uic
src_tools_uic3.subdir = $$QT_SOURCE_TREE/src/tools/uic3
src_tools_uic3.target = sub-uic3
src_tools_idc.subdir = $$QT_SOURCE_TREE/src/tools/idc
src_tools_idc.target = sub-idc

!wince*:!ordered {
    # Set dependencies for each subdir
    src_tools_moc.depends = src_tools_bootstrap
    src_tools_rcc.depends = src_tools_bootstrap
    src_tools_uic.depends = src_tools_bootstrap
}

# Special handling, depending on type of project, if it used debug/release or only has one configuration
EXTRA_DEBUG_TARGETS =
EXTRA_RELEASE_TARGETS =
!symbian {
    for(subname, TOOLS_SUBDIRS) {
        subdir = $$subname
        !isEmpty($${subname}.subdir):subdir = $$eval($${subname}.subdir)
        subpro = $$subdir/$${basename(subdir)}.pro
        !exists($$subpro):next()
        subtarget = $$replace(subdir, [^A-Za-z0-9], _)
        reg_src = $$replace(QT_SOURCE_TREE, \\\\, \\\\)
        subdir = $$replace(subdir, $$reg_src, $$QT_BUILD_TREE)
        subdir = $$replace(subdir, /, $$QMAKE_DIR_SEP)
        subdir = $$replace(subdir, \\\\, $$QMAKE_DIR_SEP)
        SUB_TEMPLATE = $$list($$fromfile($$subpro, TEMPLATE))
        !isEqual(subname, src_tools_bootstrap):if(isEqual($$SUB_TEMPLATE, lib) | isEqual($$SUB_TEMPLATE, subdirs) | isEqual(subname, src_tools_idc) | isEqual(subname, src_tools_uic3)):!separate_debug_info {
            #debug
            debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS
            debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) debug)
            EXTRA_DEBUG_TARGETS += debug-$${subtarget}
            QMAKE_EXTRA_TARGETS += debug-$${subtarget}
            #release
            release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS
            release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) release)
            EXTRA_RELEASE_TARGETS += release-$${subtarget}
            QMAKE_EXTRA_TARGETS += release-$${subtarget}
        } else { #do not have a real debug target/release
            #debug
            debug-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_DEBUG_TARGETS
            debug-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first)
            EXTRA_DEBUG_TARGETS += debug-$${subtarget}
            QMAKE_EXTRA_TARGETS += debug-$${subtarget}
            #release
            release-$${subtarget}.depends = $${subdir}$${QMAKE_DIR_SEP}$(MAKEFILE) $$EXTRA_RELEASE_TARGETS
            release-$${subtarget}.commands = (cd $$subdir && $(MAKE) -f $(MAKEFILE) first)
            EXTRA_RELEASE_TARGETS += release-$${subtarget}
            QMAKE_EXTRA_TARGETS += release-$${subtarget}
        }
    }
}

SUBDIRS = $$TOOLS_SUBDIRS $$SUBDIRS
isEqual(TARGET,tools): SUBDIRS += $$SRC_SUBDIRS