qtcreator.pro 6.6 KB
Newer Older
Eike Ziller's avatar
Eike Ziller committed
1 2
include(qtcreator.pri)

3
#version check qt
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
4
!minQtVersion(4, 8, 0) {
5
    message("Cannot build Qt Creator with Qt version $${QT_VERSION}.")
Oswald Buddenhagen's avatar
Oswald Buddenhagen committed
6
    error("Use at least Qt 4.8.0.")
7 8
}

Daniel Molkentin's avatar
Daniel Molkentin committed
9
include(doc/doc.pri)
10

con's avatar
con committed
11 12 13
TEMPLATE  = subdirs
CONFIG   += ordered

14
SUBDIRS = src share
15
unix:!macx:!isEmpty(copydata):SUBDIRS += bin
Orgad Shaneh's avatar
Orgad Shaneh committed
16
!isEmpty(BUILD_TESTS):SUBDIRS += tests
Eike Ziller's avatar
Eike Ziller committed
17 18

OTHER_FILES += dist/copyright_template.txt \
19
    $$files(dist/changes-*) \
Eike Ziller's avatar
Eike Ziller committed
20 21 22 23 24 25 26 27 28 29
    qtcreator.qbs \
    qbs/pluginspec/pluginspec.qbs \
    $$files(dist/installer/ifw/config/config-*) \
    dist/installer/ifw/packages/org.qtproject.qtcreator/meta/package.xml.in \
    dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs \
    dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/package.xml.in \
    dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/license.txt \
    $$files(scripts/*.py) \
    $$files(scripts/*.sh) \
    $$files(scripts/*.pl)
30

31
qmake_cache = $$targetPath($$IDE_BUILD_TREE/.qmake.cache)
32
!equals(QMAKE_HOST.os, Windows) {
33 34 35
    maybe_quote = "\""
    maybe_backslash = "\\"
}
36 37
system("echo $${maybe_quote}$${LITERAL_HASH} config for qmake$${maybe_quote} > $$qmake_cache")
# Make sure the qbs dll ends up alongside the Creator executable.
38
exists(src/shared/qbs/qbs.pro) {
39
    system("echo QBS_DLLDESTDIR = $${IDE_BUILD_TREE}/bin >> $$qmake_cache")
40 41
    system("echo QBS_DESTDIR = $${maybe_backslash}\"$${IDE_LIBRARY_PATH}$${maybe_backslash}\" >> $$qmake_cache")
    system("echo QBSLIBDIR = $${maybe_backslash}\"$${IDE_LIBRARY_PATH}$${maybe_backslash}\" >> $$qmake_cache")
42 43 44 45
    system("echo QBS_INSTALL_PREFIX = $${QTC_PREFIX} >> $$qmake_cache")
    system("echo QBS_LIB_INSTALL_DIR = $${QTC_PREFIX}/$${IDE_LIBRARY_BASENAME}/qtcreator >> $$qmake_cache")
    system("echo QBS_RESOURCES_BUILD_DIR = $${maybe_backslash}\"$${IDE_DATA_PATH}/qbs$${maybe_backslash}\" >> $$qmake_cache")
    system("echo QBS_RESOURCES_INSTALL_DIR = $${QTC_PREFIX}/share/qtcreator/qbs >> $$qmake_cache")
46 47
    macx {
        system("echo QBS_PLUGINS_BUILD_DIR = $${maybe_backslash}\"$${IDE_LIBRARY_PATH}$${maybe_backslash}\" >> $$qmake_cache")
48
        system("echo QBS_APPS_RPATH_DIR = @loader_path/../PlugIns >> $$qmake_cache")
49 50
    } else {
        system("echo QBS_PLUGINS_BUILD_DIR = $${maybe_backslash}\"$${IDE_BUILD_TREE}/$${IDE_LIBRARY_BASENAME}/qtcreator/$${maybe_backslash}\" >> $$qmake_cache")
51
        system("echo QBS_APPS_RPATH_DIR = '\\\$\\\$ORIGIN/../'/lib/qtcreator >> $$qmake_cache")
52
    }
53 54
    system("echo QBS_PLUGINS_INSTALL_DIR = $${QTC_PREFIX}/$${IDE_LIBRARY_BASENAME}/qtcreator >> $$qmake_cache")
    system("echo QBS_LIBRARY_DIRNAME = $${IDE_LIBRARY_BASENAME} >> $$qmake_cache")
55
    system("echo QBS_APPS_DESTDIR = $${maybe_backslash}\"$${IDE_BIN_PATH}$${maybe_backslash}\">> $$qmake_cache")
56
    system("echo QBS_APPS_INSTALL_DIR = $${QTC_PREFIX}/bin >> $$qmake_cache")
57 58
    system("echo QBS_RELATIVE_PLUGINS_PATH = $${maybe_backslash}\$$${maybe_backslash}\$relative_path$${maybe_backslash}\($${maybe_backslash}\$$${maybe_backslash}\$QBS_PLUGINS_BUILD_DIR, $${maybe_backslash}\$$${maybe_backslash}\$QBS_APPS_DESTDIR$${maybe_backslash}\)" >> $$qmake_cache)
    system("echo QBS_RELATIVE_SEARCH_PATH = $${maybe_backslash}\$$${maybe_backslash}\$relative_path$${maybe_backslash}\($${maybe_backslash}\$$${maybe_backslash}\$QBS_RESOURCES_BUILD_DIR, $${maybe_backslash}\$$${maybe_backslash}\$QBS_APPS_DESTDIR$${maybe_backslash}\)" >> $$qmake_cache)
59
    system("echo CONFIG += qbs_no_dev_install >> $$qmake_cache")
60 61
}

62 63
_QMAKE_CACHE_ = $$qmake_cache # Qt 4 support prevents us from using cache(), so tell Qt 5 about the cache

64 65 66
contains(QT_ARCH, i386): ARCHITECTURE = x86
else: ARCHITECTURE = $$QT_ARCH

67 68
macx: PLATFORM = "mac"
else:win32: PLATFORM = "windows"
69
else:linux-*: PLATFORM = "linux-$${ARCHITECTURE}"
70 71
else: PLATFORM = "unknown"

72 73
BASENAME = $$(INSTALL_BASENAME)
isEmpty(BASENAME): BASENAME = qt-creator-$${PLATFORM}$(INSTALL_EDITION)-$${QTCREATOR_VERSION}$(INSTALL_POSTFIX)
74

75
macx:INSTALLER_NAME = "qt-creator-$${QTCREATOR_VERSION}"
76
else:INSTALLER_NAME = "$${BASENAME}"
77

78 79
macx {
    APPBUNDLE = "$$OUT_PWD/bin/Qt Creator.app"
80
    BINDIST_SOURCE = "$$OUT_PWD/bin/Qt Creator.app"
Eike Ziller's avatar
Eike Ziller committed
81
    BINDIST_INSTALLER_SOURCE = $$BINDIST_SOURCE
82
    deployqt.commands = $$PWD/scripts/deployqtHelper_mac.sh \"$${APPBUNDLE}\" \"$$[QT_INSTALL_TRANSLATIONS]\" \"$$[QT_INSTALL_PLUGINS]\" \"$$[QT_INSTALL_IMPORTS]\" \"$$[QT_INSTALL_QML]\"
83
    codesign.commands = codesign -s \"$(SIGNING_IDENTITY)\" $(SIGNING_FLAGS) \"$${APPBUNDLE}\"
84
    dmg.commands = $$PWD/scripts/makedmg.sh $$OUT_PWD/bin $${BASENAME}.dmg
85
    dmg.depends = deployqt
86
    QMAKE_EXTRA_TARGETS += codesign dmg
87
} else {
88
    BINDIST_SOURCE = "$(INSTALL_ROOT)$$QTC_PREFIX"
Eike Ziller's avatar
Eike Ziller committed
89
    BINDIST_INSTALLER_SOURCE = "$$BINDIST_SOURCE/*"
90
    deployqt.commands = python -u $$PWD/scripts/deployqt.py -i \"$(INSTALL_ROOT)$$QTC_PREFIX\" \"$(QMAKE)\"
91
    deployqt.depends = install
Daniel Molkentin's avatar
Daniel Molkentin committed
92 93
    win32 {
        deployartifacts.depends = install
94
        deployartifacts.commands = git clone "git://gitorious.org/qt-creator/binary-artifacts.git" -b $$BINARY_ARTIFACTS_BRANCH&& xcopy /s /q /y /i "binary-artifacts\\win32" \"$(INSTALL_ROOT)$$QTC_PREFIX\"&& rmdir /s /q binary-artifacts
Daniel Molkentin's avatar
Daniel Molkentin committed
95 96
        QMAKE_EXTRA_TARGETS += deployartifacts
    }
97 98
}

99 100
INSTALLER_ARCHIVE_FROM_ENV = $$(INSTALLER_ARCHIVE)
isEmpty(INSTALLER_ARCHIVE_FROM_ENV) {
101
    INSTALLER_ARCHIVE = $$OUT_PWD/$${BASENAME}-installer-archive.7z
102 103 104
} else {
    INSTALLER_ARCHIVE = $$OUT_PWD/$$(INSTALLER_ARCHIVE)
}
Eike Ziller's avatar
Eike Ziller committed
105 106

bindist.depends = deployqt
107
bindist.commands = 7z a -mx9 $$OUT_PWD/$${BASENAME}.7z \"$$BINDIST_SOURCE\"
Eike Ziller's avatar
Eike Ziller committed
108
bindist_installer.depends = deployqt
109
bindist_installer.commands = 7z a -mx9 $${INSTALLER_ARCHIVE} \"$$BINDIST_INSTALLER_SOURCE\"
Eike Ziller's avatar
Eike Ziller committed
110
installer.depends = bindist_installer
111
installer.commands = python -u $$PWD/scripts/packageIfw.py -i \"$(IFW_PATH)\" -v $${QTCREATOR_VERSION} -a \"$${INSTALLER_ARCHIVE}\" "$$INSTALLER_NAME"
112 113 114 115 116 117 118 119

macx {
    # this should be very temporary:
    MENU_NIB = $$(MENU_NIB_FILE)
    isEmpty(MENU_NIB): MENU_NIB = "FATAT_SET_MENU_NIB_FILE_ENV"
    copy_menu_nib_installer.commands = cp -R \"$$MENU_NIB\" \"$${INSTALLER_NAME}.app/Contents/Resources\"

    codesign_installer.commands = codesign -s \"$(SIGNING_IDENTITY)\" $(SIGNING_FLAGS) \"$${INSTALLER_NAME}.app\"
120
    dmg_installer.commands = hdiutil create -srcfolder "$${INSTALLER_NAME}.app" -volname \"Qt Creator\" -format UDBZ "$${BASENAME}-installer.dmg" -ov -scrub -size 1g -verbose
121 122
    QMAKE_EXTRA_TARGETS += codesign_installer dmg_installer copy_menu_nib_installer
}
Daniel Molkentin's avatar
Daniel Molkentin committed
123

124 125 126
win32 {
    deployqt.commands ~= s,/,\\\\,g
    bindist.commands ~= s,/,\\\\,g
Eike Ziller's avatar
Eike Ziller committed
127 128
    bindist_installer.commands ~= s,/,\\\\,g
    installer.commands ~= s,/,\\\\,g
129
}
130

Eike Ziller's avatar
Eike Ziller committed
131
QMAKE_EXTRA_TARGETS += deployqt bindist bindist_installer installer