qtcreator.pri 3.43 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
63
    IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
con's avatar
con committed
64
    contains(QT_CONFIG, ppc):CONFIG += ppc x86
65
    copydata = 1
con's avatar
con committed
66
} else {
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
67
    win32 {
68
        contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
69 70
        IDE_APP_TARGET   = qtcreator
    } else {
dt's avatar
dt committed
71
        IDE_APP_TARGET   = qtcreator
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
72
    }
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
    IDE_BIN_PATH     = $$IDE_APP_PATH
79
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
con's avatar
con committed
80 81 82 83
}

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

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

LIBS += -L$$IDE_LIBRARY_PATH
91

92
#DEFINES += QT_NO_CAST_FROM_ASCII
93
DEFINES += QT_NO_CAST_TO_ASCII
94
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION
95

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

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

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

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
}
112

113 114 115 116 117
win32-msvc* { 
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS
}

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