qtcreator.pri 3.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
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
defineReplace(qtLibraryName) {
   unset(LIBRARY_NAME)
   LIBRARY_NAME = $$1
   CONFIG(debug, debug|release) {
      !debug_and_release|build_pass {
          mac:RET = $$member(LIBRARY_NAME, 0)_debug
              else:win32:RET = $$member(LIBRARY_NAME, 0)d
      }
   }
   isEmpty(RET):RET = $$LIBRARY_NAME
   return($$RET)
}

31 32 33 34 35 36 37 38 39 40 41 42 43
# 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)
}

44 45
isEmpty(TEST):CONFIG(debug, debug|release) {
    !debug_and_release|build_pass {
con's avatar
con committed
46 47 48 49
        TEST = 1
    }
}

50
isEmpty(IDE_LIBRARY_BASENAME) {
51 52 53
    IDE_LIBRARY_BASENAME = lib
}

54 55
DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"

56 57 58
equals(TEST, 1) {
    QT +=testlib
    DEFINES += WITH_TESTS
con's avatar
con committed
59 60
}

61
IDE_SOURCE_TREE = $$PWD
62 63 64 65 66 67
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)$,,
}
68
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
con's avatar
con committed
69
macx {
70
    IDE_APP_TARGET   = "Qt Creator"
71
    IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
72
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH
73 74
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DATA_PATH    = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
75
    IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
76
    IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
con's avatar
con committed
77
    contains(QT_CONFIG, ppc):CONFIG += ppc x86
78
    copydata = 1
con's avatar
con committed
79
} else {
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
80
    win32 {
81
        contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
82 83
        IDE_APP_TARGET   = qtcreator
    } else {
dt's avatar
dt committed
84
        IDE_APP_TARGET   = qtcreator
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
85
    }
86
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
87
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
88
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
89
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
90
    IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
91
    IDE_BIN_PATH     = $$IDE_APP_PATH
92
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
con's avatar
con committed
93 94 95 96
}

INCLUDEPATH += \
    $$IDE_SOURCE_TREE/src/libs \
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
97
    $$IDE_SOURCE_TREE/tools
con's avatar
con committed
98 99 100

DEPENDPATH += \
    $$IDE_SOURCE_TREE/src/libs \
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
101
    $$IDE_SOURCE_TREE/tools
con's avatar
con committed
102 103

LIBS += -L$$IDE_LIBRARY_PATH
104

105
#DEFINES += QT_NO_CAST_FROM_ASCII
106
DEFINES += QT_NO_CAST_TO_ASCII
107
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION
108

109
unix {
dt's avatar
dt committed
110 111
    CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
    CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
112

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

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
116 117
    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
118
}
119 120 121 122 123 124

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

126 127 128 129 130
win32-msvc* { 
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS
}

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