qtcreator.pri 3.24 KB
Newer Older
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
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) {
15
    return($$replace(1, /, $$QMAKE_DIR_SEP))
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
16
}
con's avatar
con committed
17

18 19 20 21 22 23 24 25 26 27 28 29 30
# 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)
}

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

37
isEmpty(IDE_LIBRARY_BASENAME) {
38 39 40
    IDE_LIBRARY_BASENAME = lib
}

41 42
DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"

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

48
IDE_SOURCE_TREE = $$PWD
49 50 51 52 53 54
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)$,,
}
55
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
con's avatar
con committed
56
macx {
57
    IDE_APP_TARGET   = "Qt Creator"
58
    IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
59
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH
60 61
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DATA_PATH    = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
62
    IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
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
    IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
78
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
con's avatar
con committed
79 80 81 82
}

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

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

LIBS += -L$$IDE_LIBRARY_PATH
90

91
#DEFINES += QT_NO_CAST_FROM_ASCII
92
DEFINES += QT_NO_CAST_TO_ASCII
93
DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION
94

95
unix {
dt's avatar
dt committed
96 97
    CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
    CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
98

dt's avatar
dt committed
99 100
    CONFIG(debug, debug|release):MOC_DIR = $${OUT_PWD}/.moc/debug-shared
    CONFIG(release, debug|release):MOC_DIR = $${OUT_PWD}/.moc/release-shared
101

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
102 103
    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
104
}
105 106 107 108 109 110

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
}
111 112 113 114

# Handle S60 support: default on Windows, conditionally built on other platforms.
win32:SUPPORT_QT_S60=1
else:SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)