qtcreator.pri 2.21 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 18 19
IDE_SOURCE_TREE = $$PWD

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
20

21 22
isEmpty(TEST):CONFIG(debug, debug|release) {
    !debug_and_release|build_pass {
con's avatar
con committed
23 24 25 26
        TEST = 1
    }
}

27
linux-*-64 {
28 29 30 31 32
    IDE_LIBRARY_BASENAME = lib64
} else {
    IDE_LIBRARY_BASENAME = lib
}

33 34 35
equals(TEST, 1) {
    QT +=testlib
    DEFINES += WITH_TESTS
con's avatar
con committed
36 37 38
}

isEmpty(IDE_BUILD_TREE) {
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
39
    error("qtcreator.pri: including file must define IDE_BUILD_TREE (probably a relative path)")
con's avatar
con committed
40
}
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
41
IDE_BUILD_TREE = $$cleanPath($$IDE_BUILD_TREE)
con's avatar
con committed
42
macx {
Daniel Molkentin's avatar
Daniel Molkentin committed
43
    IDE_APP_TARGET   = QtCreator
con's avatar
con committed
44
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/bin/$${IDE_APP_TARGET}.app/Contents/PlugIns
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
45 46
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/bin/$${IDE_APP_TARGET}.app/Contents/Resources
con's avatar
con committed
47 48
    contains(QT_CONFIG, ppc):CONFIG += ppc x86
} else {
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
49 50 51 52 53 54
    win32 {
        IDE_APP_TARGET   = qtcreator
    } else {
        IDE_APP_WRAPPER  = qtcreator
        IDE_APP_TARGET   = qtcreator.bin
    }
55
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
56 57
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
con's avatar
con committed
58 59 60 61 62
}
IDE_APP_PATH = $$IDE_BUILD_TREE/bin

INCLUDEPATH += \
    $$IDE_SOURCE_TREE/src/libs \
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
63
    $$IDE_SOURCE_TREE/tools
con's avatar
con committed
64 65 66

DEPENDPATH += \
    $$IDE_SOURCE_TREE/src/libs \
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
67
    $$IDE_SOURCE_TREE/tools
con's avatar
con committed
68 69

LIBS += -L$$IDE_LIBRARY_PATH
70

71 72 73
# DEFINES += QT_NO_CAST_FROM_ASCII
DEFINES += QT_NO_CAST_TO_ASCII

74 75 76 77 78 79 80
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
81 82
    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
83
}
84 85 86 87 88 89

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
}