qtcreator.pri 2.75 KB
Newer Older
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
defineReplace(cleanPath) {
    win32:1 ~= s|\\\\|/|g
    contains(1, ^/.*):pfx = /
    else:pfx =
    segs = $$split(1, /)
    out =
    for(seg, segs) {
        equals(seg, ..):out = $$member(out, 0, -2)
        else:!equals(seg, .):out += $$seg
    }
    return($$join(out, /, $$pfx))
}

defineReplace(targetPath) {
    win32:1 ~= s|/|\|g
    return($$1)
}
con's avatar
con committed
18

19
20
21
22
23
24
25
26
27
28
29
30
31
# For use in custom compilers which just copy files
win32:i_flag = i
defineReplace(stripSrcDir) {
    win32 {
        !contains(1, ^.:.*):1 = $$OUT_PWD/$$1
    } else {
        !contains(1, ^/.*):1 = $$OUT_PWD/$$1
    }
    out = $$cleanPath($$1)
    out ~= s|^$$re_escape($$PWD/)||$$i_flag
    return($$out)
}

32
33
isEmpty(TEST):CONFIG(debug, debug|release) {
    !debug_and_release|build_pass {
con's avatar
con committed
34
35
36
37
        TEST = 1
    }
}

38
linux-*-64 {
39
40
41
42
43
    IDE_LIBRARY_BASENAME = lib64
} else {
    IDE_LIBRARY_BASENAME = lib
}

44
45
46
equals(TEST, 1) {
    QT +=testlib
    DEFINES += WITH_TESTS
con's avatar
con committed
47
48
}

49
50
51
52
53
IDE_SOURCE_TREE = $$PWD
sub_dir = $$_PRO_FILE_PWD_
sub_dir ~= s,^$$re_escape($$PWD),,
IDE_BUILD_TREE = $$cleanPath($$OUT_PWD)
IDE_BUILD_TREE ~= s,$$re_escape($$sub_dir)$,,
54
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
con's avatar
con committed
55
macx {
Daniel Molkentin's avatar
Daniel Molkentin committed
56
    IDE_APP_TARGET   = QtCreator
57
    IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
58
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH
59
60
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DATA_PATH    = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
con's avatar
con committed
61
    contains(QT_CONFIG, ppc):CONFIG += ppc x86
62
    copydata = 1
con's avatar
con committed
63
} else {
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
64
    win32 {
65
        contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
66
67
68
69
70
        IDE_APP_TARGET   = qtcreator
    } else {
        IDE_APP_WRAPPER  = qtcreator
        IDE_APP_TARGET   = qtcreator.bin
    }
71
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
72
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
73
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
74
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
75
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
con's avatar
con committed
76
77
78
79
}

INCLUDEPATH += \
    $$IDE_SOURCE_TREE/src/libs \
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
80
    $$IDE_SOURCE_TREE/tools
con's avatar
con committed
81
82
83

DEPENDPATH += \
    $$IDE_SOURCE_TREE/src/libs \
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
84
    $$IDE_SOURCE_TREE/tools
con's avatar
con committed
85
86

LIBS += -L$$IDE_LIBRARY_PATH
87

88
89
90
# DEFINES += QT_NO_CAST_FROM_ASCII
DEFINES += QT_NO_CAST_TO_ASCII

91
92
93
94
95
96
97
unix {
    debug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
    release:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared

    debug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
    release:MOC_DIR = $${OUT_PWD}/.moc/release-shared

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
98
99
    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
100
}
101
102
103
104
105
106

linux-g++-* {
    # Bail out on non-selfcontained libraries. Just a security measure
    # to prevent checking in code that does not compile on other platforms.
    QMAKE_LFLAGS += -Wl,--allow-shlib-undefined -Wl,--no-undefined
}