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

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

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

LIBS += -L$$IDE_LIBRARY_PATH
89

90 91 92
# DEFINES += QT_NO_CAST_FROM_ASCII
DEFINES += QT_NO_CAST_TO_ASCII

93 94 95 96 97 98 99
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
100 101
    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
102
}
103 104 105 106 107 108

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
}