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

3
#version check qt
4
!minQtVersion(5, 6, 0) {
5
    message("Cannot build Qt Creator with Qt version $${QT_VERSION}.")
6
    error("Use at least Qt 5.6.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 \
Eike Ziller's avatar
Eike Ziller committed
19
    README.md \
20
    $$files(dist/changes-*) \
Eike Ziller's avatar
Eike Ziller committed
21
    qtcreator.qbs \
22
    qbs/pluginjson/pluginjson.qbs \
Eike Ziller's avatar
Eike Ziller committed
23 24 25 26 27 28 29 30
    $$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)
31

32
exists(src/shared/qbs/qbs.pro) {
33 34 35 36 37 38 39 40 41
    # 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)
42
    QBS_LIB_INSTALL_DIR = $$INSTALL_LIBRARY_PATH
43
    cache(QBS_LIB_INSTALL_DIR)
44
    QBS_RESOURCES_BUILD_DIR = $${IDE_DATA_PATH}/qbs
45
    cache(QBS_RESOURCES_BUILD_DIR)
46
    QBS_RESOURCES_INSTALL_DIR = $$INSTALL_DATA_PATH/qbs
47
    cache(QBS_RESOURCES_INSTALL_DIR)
48
    macx {
Eike Ziller's avatar
Eike Ziller committed
49 50
        QBS_PLUGINS_BUILD_DIR = $${IDE_PLUGIN_PATH}
        QBS_APPS_RPATH_DIR = @loader_path/../Frameworks
51
    } else {
52
        QBS_PLUGINS_BUILD_DIR = $$IDE_PLUGIN_PATH
53
        QBS_APPS_RPATH_DIR = \$\$ORIGIN/../$$IDE_LIBRARY_BASENAME/qtcreator
54
    }
55 56
    cache(QBS_PLUGINS_BUILD_DIR)
    cache(QBS_APPS_RPATH_DIR)
57
    QBS_PLUGINS_INSTALL_DIR = $$INSTALL_PLUGIN_PATH
58 59 60
    cache(QBS_PLUGINS_INSTALL_DIR)
    QBS_LIBRARY_DIRNAME = $${IDE_LIBRARY_BASENAME}
    cache(QBS_LIBRARY_DIRNAME)
61
    QBS_APPS_DESTDIR = $${IDE_BIN_PATH}
62
    cache(QBS_APPS_DESTDIR)
63
    QBS_APPS_INSTALL_DIR = $$INSTALL_BIN_PATH
64
    cache(QBS_APPS_INSTALL_DIR)
65 66
    QBS_LIBEXEC_DESTDIR = $${IDE_LIBEXEC_PATH}
    cache(QBS_LIBEXEC_DESTDIR)
67
    QBS_LIBEXEC_INSTALL_DIR = $$INSTALL_LIBEXEC_PATH
68 69 70 71
    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)
72
    QBS_RELATIVE_PLUGINS_PATH = $$relative_path($$QBS_PLUGINS_BUILD_DIR, $$QBS_APPS_DESTDIR$$)
73
    cache(QBS_RELATIVE_PLUGINS_PATH)
74
    QBS_RELATIVE_SEARCH_PATH = $$relative_path($$QBS_RESOURCES_BUILD_DIR, $$QBS_APPS_DESTDIR)
75
    cache(QBS_RELATIVE_SEARCH_PATH)
76 77 78 79
    !qbs_no_dev_install {
        QBS_CONFIG_ADDITION = qbs_no_dev_install qbs_enable_project_file_updates
        cache(CONFIG, add, QBS_CONFIG_ADDITION)
    }
80 81

    # Create qbs documentation targets.
Joerg Bornemann's avatar
Joerg Bornemann committed
82 83 84
    DOC_FILES =
    DOC_TARGET_PREFIX = qbs_
    include(src/shared/qbs/doc/doc_shared.pri)
85 86
    include(src/shared/qbs/doc/doc_targets.pri)
    docs.depends += qbs_docs
Joerg Bornemann's avatar
Joerg Bornemann committed
87 88 89 90 91
    !build_online_docs {
        install_docs.depends += install_qbs_docs
    }
    unset(DOC_FILES)
    unset(DOC_TARGET_PREFIX)
92 93
}

94 95 96
contains(QT_ARCH, i386): ARCHITECTURE = x86
else: ARCHITECTURE = $$QT_ARCH

97 98
macx: PLATFORM = "mac"
else:win32: PLATFORM = "windows"
99
else:linux-*: PLATFORM = "linux-$${ARCHITECTURE}"
100 101
else: PLATFORM = "unknown"

102 103
BASENAME = $$(INSTALL_BASENAME)
isEmpty(BASENAME): BASENAME = qt-creator-$${PLATFORM}$(INSTALL_EDITION)-$${QTCREATOR_VERSION}$(INSTALL_POSTFIX)
104

105
macx:INSTALLER_NAME = "qt-creator-$${QTCREATOR_VERSION}"
106
else:INSTALLER_NAME = "$${BASENAME}"
107

108 109 110 111 112 113 114 115 116 117
linux {
    appstream.files = dist/org.qt-project.qtcreator.appdata.xml
    appstream.path = $$QTC_PREFIX/share/metainfo/

    desktop.files = dist/org.qt-project.qtcreator.desktop
    desktop.path = $$QTC_PREFIX/share/applications/

    INSTALLS += appstream desktop
}

118 119
macx {
    APPBUNDLE = "$$OUT_PWD/bin/Qt Creator.app"
120
    BINDIST_SOURCE = "$$OUT_PWD/bin/Qt Creator.app"
Eike Ziller's avatar
Eike Ziller committed
121
    BINDIST_INSTALLER_SOURCE = $$BINDIST_SOURCE
Eike Ziller's avatar
Eike Ziller committed
122
    deployqt.commands = $$PWD/scripts/deployqtHelper_mac.sh \"$${APPBUNDLE}\" \"$$[QT_INSTALL_BINS]\" \"$$[QT_INSTALL_TRANSLATIONS]\" \"$$[QT_INSTALL_PLUGINS]\" \"$$[QT_INSTALL_IMPORTS]\" \"$$[QT_INSTALL_QML]\"
123
    codesign.commands = codesign --deep -s \"$(SIGNING_IDENTITY)\" $(SIGNING_FLAGS) \"$${APPBUNDLE}\"
124
    dmg.commands = $$PWD/scripts/makedmg.sh $$OUT_PWD/bin $${BASENAME}.dmg
125
    #dmg.depends = deployqt
126
    QMAKE_EXTRA_TARGETS += codesign dmg
127
} else {
128
    BINDIST_SOURCE = "$(INSTALL_ROOT)$$QTC_PREFIX"
Eike Ziller's avatar
Eike Ziller committed
129
    BINDIST_INSTALLER_SOURCE = "$$BINDIST_SOURCE/*"
130
    deployqt.commands = python -u $$PWD/scripts/deployqt.py -i \"$(INSTALL_ROOT)$$QTC_PREFIX\" \"$(QMAKE)\"
131
    deployqt.depends = install
132 133
    win32 {
        deployartifacts.depends = install
134 135
        deployartifacts.commands = git clone --depth 1 -b $$BINARY_ARTIFACTS_BRANCH \
                "http://code.qt.io/qt-creator/binary-artifacts.git" \
136 137
            && xcopy /s /q /y /i "binary-artifacts\\win32" \"$(INSTALL_ROOT)$$QTC_PREFIX\" \
            && rmdir /s /q binary-artifacts
138 139
        QMAKE_EXTRA_TARGETS += deployartifacts
    }
140 141
}

142 143
INSTALLER_ARCHIVE_FROM_ENV = $$(INSTALLER_ARCHIVE)
isEmpty(INSTALLER_ARCHIVE_FROM_ENV) {
144
    INSTALLER_ARCHIVE = $$OUT_PWD/$${BASENAME}-installer-archive.7z
145 146 147
} else {
    INSTALLER_ARCHIVE = $$OUT_PWD/$$(INSTALLER_ARCHIVE)
}
Eike Ziller's avatar
Eike Ziller committed
148

149
#bindist.depends = deployqt
150
bindist.commands = 7z a -mx9 $$OUT_PWD/$${BASENAME}.7z \"$$BINDIST_SOURCE\"
151
#bindist_installer.depends = deployqt
152
bindist_installer.commands = 7z a -mx9 $${INSTALLER_ARCHIVE} \"$$BINDIST_INSTALLER_SOURCE\"
Eike Ziller's avatar
Eike Ziller committed
153
installer.depends = bindist_installer
154
installer.commands = python -u $$PWD/scripts/packageIfw.py -i \"$(IFW_PATH)\" -v $${QTCREATOR_VERSION} -a \"$${INSTALLER_ARCHIVE}\" "$$INSTALLER_NAME"
155 156 157

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

162 163 164
win32 {
    deployqt.commands ~= s,/,\\\\,g
    bindist.commands ~= s,/,\\\\,g
Eike Ziller's avatar
Eike Ziller committed
165 166
    bindist_installer.commands ~= s,/,\\\\,g
    installer.commands ~= s,/,\\\\,g
167
}
168

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