qtcreator.pri 4.25 KB
Newer Older
1 2 3
!isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included")
QTCREATOR_PRI_INCLUDED = 1

Eike Ziller's avatar
Eike Ziller committed
4
QTCREATOR_VERSION = 2.4.81
5

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19
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) {
20
    return($$replace(1, /, $$QMAKE_DIR_SEP))
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
21
}
con's avatar
con committed
22

23 24 25 26 27 28 29 30 31 32 33 34 35
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)
}

36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
defineTest(minQtVersion) {
    maj = $$1
    min = $$2
    patch = $$3
    isEqual(QT_MAJOR_VERSION, $$maj) {
        isEqual(QT_MINOR_VERSION, $$min) {
            isEqual(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
            greaterThan(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
        }
        greaterThan(QT_MINOR_VERSION, $$min) {
            return(true)
        }
    }
53 54 55
    greaterThan(QT_MAJOR_VERSION, $$maj) {
        return(true)
    }
56 57 58
    return(false)
}

59 60 61 62 63 64 65 66 67 68 69 70 71
# 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)
}

72 73
isEmpty(TEST):CONFIG(debug, debug|release) {
    !debug_and_release|build_pass {
con's avatar
con committed
74 75 76 77
        TEST = 1
    }
}

78
isEmpty(IDE_LIBRARY_BASENAME) {
79 80
    IDE_LIBRARY_BASENAME = lib
}
81

82 83 84
equals(TEST, 1) {
    QT +=testlib
    DEFINES += WITH_TESTS
con's avatar
con committed
85 86
}

87
IDE_SOURCE_TREE = $$PWD
88 89 90 91 92 93
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)$,,
}
94
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
con's avatar
con committed
95
macx {
96
    IDE_APP_TARGET   = "Qt Creator"
97
    IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
98
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH
99 100
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DATA_PATH    = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
101
    IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
102
    IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
con's avatar
con committed
103
    contains(QT_CONFIG, ppc):CONFIG += ppc x86
104
    copydata = 1
105
    isEmpty(TIGER_COMPAT_MODE):TIGER_COMPAT_MODE=$$(QTC_TIGER_COMPAT)
106 107 108 109
    isEmpty(TIGER_COMPAT_MODE) {
        QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5
        QMAKE_LFLAGS *= -mmacosx-version-min=10.5
    }
con's avatar
con committed
110
} else {
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
111 112
    contains(TEMPLATE, vc.*):vcproj = 1
    IDE_APP_TARGET   = qtcreator
113
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
114
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
115
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
116
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
117
    IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
118
    IDE_BIN_PATH     = $$IDE_APP_PATH
119
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
con's avatar
con committed
120 121 122
}

INCLUDEPATH += \
123
    $$IDE_BUILD_TREE/src \ # for <app/app_version.h>
con's avatar
con committed
124
    $$IDE_SOURCE_TREE/src/libs \
125 126
    $$IDE_SOURCE_TREE/tools \
    $$IDE_SOURCE_TREE/src/plugins
con's avatar
con committed
127

128
CONFIG += depend_includepath
con's avatar
con committed
129 130

LIBS += -L$$IDE_LIBRARY_PATH
131

132 133 134 135 136 137
!isEmpty(vcproj) {
    DEFINES += IDE_LIBRARY_BASENAME=\"$$IDE_LIBRARY_BASENAME\"
} else {
    DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"
}

138
#DEFINES += QT_NO_CAST_FROM_ASCII
139
DEFINES += QT_NO_CAST_TO_ASCII
140
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION
141

142
unix {
dt's avatar
dt committed
143 144
    CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
    CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
145

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

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
149 150
    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
151
}
152

153 154 155 156
win32-msvc* { 
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS
}