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

Robert Loehning's avatar
Robert Loehning committed
4 5 6
QTCREATOR_VERSION = 3.3.81
QTCREATOR_COMPAT_VERSION = 3.3.81
BINARY_ARTIFACTS_BRANCH = master
7

Eike Ziller's avatar
Eike Ziller committed
8
# enable c++11
9
CONFIG += c++11
10

11 12 13 14 15 16 17 18 19 20 21 22 23
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)
}

24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
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)
        }
    }
41 42 43
    greaterThan(QT_MAJOR_VERSION, $$maj) {
        return(true)
    }
44 45 46
    return(false)
}

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

52 53
!isEmpty(BUILD_TESTS):TEST = 1

54 55
isEmpty(TEST):CONFIG(debug, debug|release) {
    !debug_and_release|build_pass {
con's avatar
con committed
56 57 58 59
        TEST = 1
    }
}

60
isEmpty(IDE_LIBRARY_BASENAME) {
61 62
    IDE_LIBRARY_BASENAME = lib
}
63

64 65 66
equals(TEST, 1) {
    QT +=testlib
    DEFINES += WITH_TESTS
con's avatar
con committed
67 68
}

69
IDE_SOURCE_TREE = $$PWD
70 71 72
isEmpty(IDE_BUILD_TREE) {
    sub_dir = $$_PRO_FILE_PWD_
    sub_dir ~= s,^$$re_escape($$PWD),,
73
    IDE_BUILD_TREE = $$clean_path($$OUT_PWD)
74 75
    IDE_BUILD_TREE ~= s,$$re_escape($$sub_dir)$,,
}
76
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
con's avatar
con committed
77
macx {
78
    IDE_APP_TARGET   = "Qt Creator"
Eike Ziller's avatar
Eike Ziller committed
79 80
    IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Frameworks
    IDE_PLUGIN_PATH  = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
81 82
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DATA_PATH    = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
83
    IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
84
    IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
85
    copydata = 1
con's avatar
con committed
86
} else {
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
87 88
    contains(TEMPLATE, vc.*):vcproj = 1
    IDE_APP_TARGET   = qtcreator
89
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
90
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
91
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
92
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
93
    IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
94
    IDE_BIN_PATH     = $$IDE_APP_PATH
95
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
con's avatar
con committed
96 97 98
}

INCLUDEPATH += \
99
    $$IDE_BUILD_TREE/src \ # for <app/app_version.h>
con's avatar
con committed
100
    $$IDE_SOURCE_TREE/src/libs \
101 102
    $$IDE_SOURCE_TREE/tools

103 104
QTC_PLUGIN_DIRS_FROM_ENVIRONMENT = $$(QTC_PLUGIN_DIRS)
QTC_PLUGIN_DIRS += $$split(QTC_PLUGIN_DIRS_FROM_ENVIRONMENT, $$QMAKE_DIRLIST_SEP)
105
QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
Eike Ziller's avatar
Eike Ziller committed
106
for(dir, QTC_PLUGIN_DIRS) {
107 108
    INCLUDEPATH += $$dir
}
con's avatar
con committed
109

110
CONFIG += depend_includepath
con's avatar
con committed
111 112

LIBS += -L$$IDE_LIBRARY_PATH
113

114 115 116 117 118 119
!isEmpty(vcproj) {
    DEFINES += IDE_LIBRARY_BASENAME=\"$$IDE_LIBRARY_BASENAME\"
} else {
    DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"
}

120
DEFINES += QT_CREATOR QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
121
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION
122

123
unix {
dt's avatar
dt committed
124 125
    CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
    CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
126

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

Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
130 131
    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
132
}
133

134
win32-msvc* {
135 136
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS
137
    QMAKE_CXXFLAGS_WARN_ON *= -w44996
138 139
    # Speed up startup time when debugging with cdb
    QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
140
}
141

142
qt {
143
    contains(QT, core): QT += concurrent
144 145
    contains(QT, gui): QT += widgets
}
146

147
QBSFILE = $$replace(_PRO_FILE_, \\.pro$, .qbs)
148
exists($$QBSFILE):DISTFILES += $$QBSFILE
149

150
!isEmpty(QTC_PLUGIN_DEPENDS):LIBS *= -L$$IDE_PLUGIN_PATH
151 152 153 154 155 156 157
# recursively resolve plugin deps
done_plugins =
for(ever) {
    isEmpty(QTC_PLUGIN_DEPENDS): \
        break()
    done_plugins += $$QTC_PLUGIN_DEPENDS
    for(dep, QTC_PLUGIN_DEPENDS) {
158 159 160 161 162 163 164 165 166 167
        dependencies_file =
        for(dir, QTC_PLUGIN_DIRS) {
            exists($$dir/$$dep/$${dep}_dependencies.pri) {
                dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri
                break()
            }
        }
        isEmpty(dependencies_file): \
            error("Plugin dependency $$dep not found")
        include($$dependencies_file)
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
        LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME)
    }
    QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
    QTC_PLUGIN_DEPENDS -= $$unique(done_plugins)
}

# recursively resolve library deps
done_libs =
for(ever) {
    isEmpty(QTC_LIB_DEPENDS): \
        break()
    done_libs += $$QTC_LIB_DEPENDS
    for(dep, QTC_LIB_DEPENDS) {
        include($$PWD/src/libs/$$dep/$${dep}_dependencies.pri)
        LIBS += -l$$qtLibraryName($$QTC_LIB_NAME)
    }
    QTC_LIB_DEPENDS = $$unique(QTC_LIB_DEPENDS)
    QTC_LIB_DEPENDS -= $$unique(done_libs)
}