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

Kai Koehne's avatar
Kai Koehne committed
4
QTCREATOR_VERSION = 2.7.81
5

6 7 8 9 10 11 12 13 14 15 16 17
isEqual(QT_MAJOR_VERSION, 5) {

defineReplace(cleanPath) {
    return($$clean_path($$1))
}

defineReplace(targetPath) {
    return($$shell_path($$1))
}

} else { # qt5

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31
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) {
32
    return($$replace(1, /, $$QMAKE_DIR_SEP))
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
33
}
con's avatar
con committed
34

35 36
} # qt5

37 38 39 40 41 42 43 44 45 46 47 48 49
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)
}

50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
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)
        }
    }
67 68 69
    greaterThan(QT_MAJOR_VERSION, $$maj) {
        return(true)
    }
70 71 72
    return(false)
}

73 74 75 76 77 78 79 80 81
isEqual(QT_MAJOR_VERSION, 5) {

# For use in custom compilers which just copy files
defineReplace(stripSrcDir) {
    return($$relative_path($$absolute_path($$1, $$OUT_PWD), $$_PRO_FILE_PWD_))
}

} else { # qt5

82 83 84 85 86 87 88 89 90
# 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)
91
    out ~= s|^$$re_escape($$_PRO_FILE_PWD_/)||$$i_flag
92 93 94
    return($$out)
}

95 96
} # qt5

97 98
!isEmpty(BUILD_TESTS):TEST = 1

99 100
isEmpty(TEST):CONFIG(debug, debug|release) {
    !debug_and_release|build_pass {
con's avatar
con committed
101 102 103 104
        TEST = 1
    }
}

105
isEmpty(IDE_LIBRARY_BASENAME) {
106 107
    IDE_LIBRARY_BASENAME = lib
}
108

109 110 111
equals(TEST, 1) {
    QT +=testlib
    DEFINES += WITH_TESTS
con's avatar
con committed
112 113
}

114
IDE_SOURCE_TREE = $$PWD
115 116 117 118 119 120
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)$,,
}
121
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
con's avatar
con committed
122
macx {
123
    IDE_APP_TARGET   = "Qt Creator"
124
    IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
125
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH
126 127
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DATA_PATH    = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
128
    IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
129
    IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
130
    copydata = 1
131
    isEmpty(TIGER_COMPAT_MODE):TIGER_COMPAT_MODE=$$(QTC_TIGER_COMPAT)
132 133 134 135 136 137
    !isEqual(QT_MAJOR_VERSION, 5) {
        # Qt5 doesn't support 10.5, and will set the minimum version correctly to 10.6 or 10.7.
        isEmpty(TIGER_COMPAT_MODE) {
            QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5
            QMAKE_LFLAGS *= -mmacosx-version-min=10.5
        }
138
    }
con's avatar
con committed
139
} else {
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
140 141
    contains(TEMPLATE, vc.*):vcproj = 1
    IDE_APP_TARGET   = qtcreator
142
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
143
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
144
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
145
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
146
    IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
147
    IDE_BIN_PATH     = $$IDE_APP_PATH
148
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
con's avatar
con committed
149 150 151
}

INCLUDEPATH += \
152
    $$IDE_BUILD_TREE/src \ # for <app/app_version.h>
con's avatar
con committed
153
    $$IDE_SOURCE_TREE/src/libs \
154 155
    $$IDE_SOURCE_TREE/tools \
    $$IDE_SOURCE_TREE/src/plugins
con's avatar
con committed
156

157
CONFIG += depend_includepath
con's avatar
con committed
158 159

LIBS += -L$$IDE_LIBRARY_PATH
160

161 162 163 164 165 166
!isEmpty(vcproj) {
    DEFINES += IDE_LIBRARY_BASENAME=\"$$IDE_LIBRARY_BASENAME\"
} else {
    DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"
}

167
DEFINES += QT_CREATOR QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
168
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION
169

170
unix {
dt's avatar
dt committed
171 172
    CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
    CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
173

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

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
177 178
    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
179
}
180

181 182 183 184
win32-msvc* { 
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS
}
185 186

qt:greaterThan(QT_MAJOR_VERSION, 4) {
187
    contains(QT, core): QT += concurrent
188
    contains(QT, gui): QT += widgets
189
    DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
190
}
191

192 193
QBSFILE = $$replace(_PRO_FILE_, \\.pro$, .qbs)
exists($$QBSFILE):OTHER_FILES += $$QBSFILE