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

3
#version check qt
Christian Stenger's avatar
Christian Stenger committed
4
!minQtVersion(5, 4, 0) {
5
    message("Cannot build Qt Creator with Qt version $${QT_VERSION}.")
Christian Stenger's avatar
Christian Stenger committed
6
    error("Use at least Qt 5.4.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
DISTFILES += dist/copyright_template.txt \
19
    $$files(dist/changes-*) \
Eike Ziller's avatar
Eike Ziller committed
20
    qtcreator.qbs \
21
    qbs/pluginjson/pluginjson.qbs \
Eike Ziller's avatar
Eike Ziller committed
22 23 24 25 26 27 28 29
    $$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
exists(src/shared/qbs/qbs.pro) {
32 33 34 35 36 37 38 39 40 41 42
    # Make sure the qbs dll ends up alongside the Creator executable.
    QBS_DLLDESTDIR = $${IDE_BUILD_TREE}/bin
    cache(QBS_DLLDESTDIR)
    QBS_DESTDIR = $${IDE_LIBRARY_PATH}
    cache(QBS_DESTDIR)
    QBSLIBDIR = $${IDE_LIBRARY_PATH}
    cache(QBSLIBDIR)
    QBS_INSTALL_PREFIX = $${QTC_PREFIX}
    cache(QBS_INSTALL_PREFIX)
    QBS_LIB_INSTALL_DIR = $${QTC_PREFIX}/$${IDE_LIBRARY_BASENAME}/qtcreator
    cache(QBS_LIB_INSTALL_DIR)
43
    QBS_RESOURCES_BUILD_DIR = $${IDE_DATA_PATH}/qbs
44 45 46
    cache(QBS_RESOURCES_BUILD_DIR)
    QBS_RESOURCES_INSTALL_DIR = $${QTC_PREFIX}/share/qtcreator/qbs
    cache(QBS_RESOURCES_INSTALL_DIR)
47
    macx {
Eike Ziller's avatar
Eike Ziller committed
48 49
        QBS_PLUGINS_BUILD_DIR = $${IDE_PLUGIN_PATH}
        QBS_APPS_RPATH_DIR = @loader_path/../Frameworks
50
    } else {
Eike Ziller's avatar
Eike Ziller committed
51
        QBS_PLUGINS_BUILD_DIR = $${IDE_BUILD_TREE}/$${IDE_LIBRARY_BASENAME}/qtcreator/plugins
52
        QBS_APPS_RPATH_DIR = \$\$ORIGIN/../$$IDE_LIBRARY_BASENAME/qtcreator
53
    }
54 55
    cache(QBS_PLUGINS_BUILD_DIR)
    cache(QBS_APPS_RPATH_DIR)
Eike Ziller's avatar
Eike Ziller committed
56
    QBS_PLUGINS_INSTALL_DIR = $${QTC_PREFIX}/$${IDE_LIBRARY_BASENAME}/qtcreator/plugins
57 58 59
    cache(QBS_PLUGINS_INSTALL_DIR)
    QBS_LIBRARY_DIRNAME = $${IDE_LIBRARY_BASENAME}
    cache(QBS_LIBRARY_DIRNAME)
60
    QBS_APPS_DESTDIR = $${IDE_BIN_PATH}
61 62 63
    cache(QBS_APPS_DESTDIR)
    QBS_APPS_INSTALL_DIR = $${QTC_PREFIX}/bin
    cache(QBS_APPS_INSTALL_DIR)
64 65 66 67 68 69 70
    QBS_LIBEXEC_DESTDIR = $${IDE_LIBEXEC_PATH}
    cache(QBS_LIBEXEC_DESTDIR)
    QBS_LIBEXEC_INSTALL_DIR = $${QTC_PREFIX}/bin
    cache(QBS_LIBEXEC_INSTALL_DIR)
    QBS_RELATIVE_LIBEXEC_PATH = $$relative_path($$QBS_LIBEXEC_DESTDIR, $$QBS_APPS_DESTDIR)
    isEmpty(QBS_RELATIVE_LIBEXEC_PATH):QBS_RELATIVE_LIBEXEC_PATH = .
    cache(QBS_RELATIVE_LIBEXEC_PATH)
71
    QBS_RELATIVE_PLUGINS_PATH = $$relative_path($$QBS_PLUGINS_BUILD_DIR, $$QBS_APPS_DESTDIR$$)
72
    cache(QBS_RELATIVE_PLUGINS_PATH)
73
    QBS_RELATIVE_SEARCH_PATH = $$relative_path($$QBS_RESOURCES_BUILD_DIR, $$QBS_APPS_DESTDIR)
74
    cache(QBS_RELATIVE_SEARCH_PATH)
75 76 77 78
    !qbs_no_dev_install {
        QBS_CONFIG_ADDITION = qbs_no_dev_install qbs_enable_project_file_updates
        cache(CONFIG, add, QBS_CONFIG_ADDITION)
    }
79 80
}

81 82 83
contains(QT_ARCH, i386): ARCHITECTURE = x86
else: ARCHITECTURE = $$QT_ARCH

84 85
macx: PLATFORM = "mac"
else:win32: PLATFORM = "windows"
86
else:linux-*: PLATFORM = "linux-$${ARCHITECTURE}"
87 88
else: PLATFORM = "unknown"

89 90
BASENAME = $$(INSTALL_BASENAME)
isEmpty(BASENAME): BASENAME = qt-creator-$${PLATFORM}$(INSTALL_EDITION)-$${QTCREATOR_VERSION}$(INSTALL_POSTFIX)
91

92
macx:INSTALLER_NAME = "qt-creator-$${QTCREATOR_VERSION}"
93
else:INSTALLER_NAME = "$${BASENAME}"
94

95 96
macx {
    APPBUNDLE = "$$OUT_PWD/bin/Qt Creator.app"
97
    BINDIST_SOURCE = "$$OUT_PWD/bin/Qt Creator.app"
Eike Ziller's avatar
Eike Ziller committed
98
    BINDIST_INSTALLER_SOURCE = $$BINDIST_SOURCE
99
    deployqt.commands = $$PWD/scripts/deployqtHelper_mac.sh \"$${APPBUNDLE}\" \"$$[QT_INSTALL_TRANSLATIONS]\" \"$$[QT_INSTALL_PLUGINS]\" \"$$[QT_INSTALL_IMPORTS]\" \"$$[QT_INSTALL_QML]\"
100
    codesign.commands = codesign --deep -s \"$(SIGNING_IDENTITY)\" $(SIGNING_FLAGS) \"$${APPBUNDLE}\"
101
    dmg.commands = $$PWD/scripts/makedmg.sh $$OUT_PWD/bin $${BASENAME}.dmg
102
    #dmg.depends = deployqt
103
    QMAKE_EXTRA_TARGETS += codesign dmg
104
} else {
105
    BINDIST_SOURCE = "$(INSTALL_ROOT)$$QTC_PREFIX"
Eike Ziller's avatar
Eike Ziller committed
106
    BINDIST_INSTALLER_SOURCE = "$$BINDIST_SOURCE/*"
107
    deployqt.commands = python -u $$PWD/scripts/deployqt.py -i \"$(INSTALL_ROOT)$$QTC_PREFIX\" \"$(QMAKE)\"
108
    deployqt.depends = install
Daniel Molkentin's avatar
Daniel Molkentin committed
109 110
    win32 {
        deployartifacts.depends = install
Eike Ziller's avatar
Eike Ziller committed
111
        deployartifacts.commands = git clone "git://code.qt.io/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
112 113
        QMAKE_EXTRA_TARGETS += deployartifacts
    }
114 115
}

116 117
INSTALLER_ARCHIVE_FROM_ENV = $$(INSTALLER_ARCHIVE)
isEmpty(INSTALLER_ARCHIVE_FROM_ENV) {
118
    INSTALLER_ARCHIVE = $$OUT_PWD/$${BASENAME}-installer-archive.7z
119 120 121
} else {
    INSTALLER_ARCHIVE = $$OUT_PWD/$$(INSTALLER_ARCHIVE)
}
Eike Ziller's avatar
Eike Ziller committed
122

123
#bindist.depends = deployqt
124
bindist.commands = 7z a -mx9 $$OUT_PWD/$${BASENAME}.7z \"$$BINDIST_SOURCE\"
125
#bindist_installer.depends = deployqt
126
bindist_installer.commands = 7z a -mx9 $${INSTALLER_ARCHIVE} \"$$BINDIST_INSTALLER_SOURCE\"
Eike Ziller's avatar
Eike Ziller committed
127
installer.depends = bindist_installer
128
installer.commands = python -u $$PWD/scripts/packageIfw.py -i \"$(IFW_PATH)\" -v $${QTCREATOR_VERSION} -a \"$${INSTALLER_ARCHIVE}\" "$$INSTALLER_NAME"
129 130 131

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

136 137 138
win32 {
    deployqt.commands ~= s,/,\\\\,g
    bindist.commands ~= s,/,\\\\,g
Eike Ziller's avatar
Eike Ziller committed
139 140
    bindist_installer.commands ~= s,/,\\\\,g
    installer.commands ~= s,/,\\\\,g
141
}
142

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