Bump version
[qt-creator:qt-creator.git] / qtcreator.pro
1 include(qtcreator.pri)
2
3 #version check qt
4 !minQtVersion(5, 3, 1) {
5     message("Cannot build Qt Creator with Qt version $${QT_VERSION}.")
6     error("Use at least Qt 5.3.1.")
7 }
8
9 include(doc/doc.pri)
10
11 TEMPLATE  = subdirs
12 CONFIG   += ordered
13
14 SUBDIRS = src share
15 unix:!macx:!isEmpty(copydata):SUBDIRS += bin
16 !isEmpty(BUILD_TESTS):SUBDIRS += tests
17
18 DISTFILES += dist/copyright_template.txt \
19     $$files(dist/changes-*) \
20     qtcreator.qbs \
21     qbs/pluginjson/pluginjson.qbs \
22     $$files(dist/installer/ifw/config/config-*) \
23     dist/installer/ifw/packages/org.qtproject.qtcreator/meta/package.xml.in \
24     dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs \
25     dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/package.xml.in \
26     dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/license.txt \
27     $$files(scripts/*.py) \
28     $$files(scripts/*.sh) \
29     $$files(scripts/*.pl)
30
31 exists(src/shared/qbs/qbs.pro) {
32     # Make sure the qbs dll ends up alongside the Creator executable.
33     QBS_DLLDESTDIR = $${IDE_BUILD_TREE}/bin
34     cache(QBS_DLLDESTDIR)
35     QBS_DESTDIR = $${IDE_LIBRARY_PATH}
36     cache(QBS_DESTDIR)
37     QBSLIBDIR = $${IDE_LIBRARY_PATH}
38     cache(QBSLIBDIR)
39     QBS_INSTALL_PREFIX = $${QTC_PREFIX}
40     cache(QBS_INSTALL_PREFIX)
41     QBS_LIB_INSTALL_DIR = $${QTC_PREFIX}/$${IDE_LIBRARY_BASENAME}/qtcreator
42     cache(QBS_LIB_INSTALL_DIR)
43     QBS_RESOURCES_BUILD_DIR = $${IDE_DATA_PATH}/qbs
44     cache(QBS_RESOURCES_BUILD_DIR)
45     QBS_RESOURCES_INSTALL_DIR = $${QTC_PREFIX}/share/qtcreator/qbs
46     cache(QBS_RESOURCES_INSTALL_DIR)
47     macx {
48         QBS_PLUGINS_BUILD_DIR = $${IDE_PLUGIN_PATH}
49         QBS_APPS_RPATH_DIR = @loader_path/../Frameworks
50     } else {
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     cache(QBS_PLUGINS_BUILD_DIR)
55     cache(QBS_APPS_RPATH_DIR)
56     QBS_PLUGINS_INSTALL_DIR = $${QTC_PREFIX}/$${IDE_LIBRARY_BASENAME}/qtcreator/plugins
57     cache(QBS_PLUGINS_INSTALL_DIR)
58     QBS_LIBRARY_DIRNAME = $${IDE_LIBRARY_BASENAME}
59     cache(QBS_LIBRARY_DIRNAME)
60     QBS_APPS_DESTDIR = $${IDE_BIN_PATH}
61     cache(QBS_APPS_DESTDIR)
62     QBS_APPS_INSTALL_DIR = $${QTC_PREFIX}/bin
63     cache(QBS_APPS_INSTALL_DIR)
64     QBS_RELATIVE_PLUGINS_PATH = $$relative_path($$QBS_PLUGINS_BUILD_DIR, $$QBS_APPS_DESTDIR$$)
65     cache(QBS_RELATIVE_PLUGINS_PATH)
66     QBS_RELATIVE_SEARCH_PATH = $$relative_path($$QBS_RESOURCES_BUILD_DIR, $$QBS_APPS_DESTDIR)
67     cache(QBS_RELATIVE_SEARCH_PATH)
68     !qbs_no_dev_install {
69         QBS_CONFIG_ADDITION = qbs_no_dev_install qbs_enable_project_file_updates
70         cache(CONFIG, add, QBS_CONFIG_ADDITION)
71     }
72 }
73
74 contains(QT_ARCH, i386): ARCHITECTURE = x86
75 else: ARCHITECTURE = $$QT_ARCH
76
77 macx: PLATFORM = "mac"
78 else:win32: PLATFORM = "windows"
79 else:linux-*: PLATFORM = "linux-$${ARCHITECTURE}"
80 else: PLATFORM = "unknown"
81
82 BASENAME = $$(INSTALL_BASENAME)
83 isEmpty(BASENAME): BASENAME = qt-creator-$${PLATFORM}$(INSTALL_EDITION)-$${QTCREATOR_VERSION}$(INSTALL_POSTFIX)
84
85 macx:INSTALLER_NAME = "qt-creator-$${QTCREATOR_VERSION}"
86 else:INSTALLER_NAME = "$${BASENAME}"
87
88 macx {
89     APPBUNDLE = "$$OUT_PWD/bin/Qt Creator.app"
90     BINDIST_SOURCE = "$$OUT_PWD/bin/Qt Creator.app"
91     BINDIST_INSTALLER_SOURCE = $$BINDIST_SOURCE
92     deployqt.commands = $$PWD/scripts/deployqtHelper_mac.sh \"$${APPBUNDLE}\" \"$$[QT_INSTALL_TRANSLATIONS]\" \"$$[QT_INSTALL_PLUGINS]\" \"$$[QT_INSTALL_IMPORTS]\" \"$$[QT_INSTALL_QML]\"
93     codesign.commands = codesign --deep -s \"$(SIGNING_IDENTITY)\" $(SIGNING_FLAGS) \"$${APPBUNDLE}\"
94     dmg.commands = $$PWD/scripts/makedmg.sh $$OUT_PWD/bin $${BASENAME}.dmg
95     #dmg.depends = deployqt
96     QMAKE_EXTRA_TARGETS += codesign dmg
97 } else {
98     BINDIST_SOURCE = "$(INSTALL_ROOT)$$QTC_PREFIX"
99     BINDIST_INSTALLER_SOURCE = "$$BINDIST_SOURCE/*"
100     deployqt.commands = python -u $$PWD/scripts/deployqt.py -i \"$(INSTALL_ROOT)$$QTC_PREFIX\" \"$(QMAKE)\"
101     deployqt.depends = install
102     win32 {
103         deployartifacts.depends = install
104         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
105         QMAKE_EXTRA_TARGETS += deployartifacts
106     }
107 }
108
109 INSTALLER_ARCHIVE_FROM_ENV = $$(INSTALLER_ARCHIVE)
110 isEmpty(INSTALLER_ARCHIVE_FROM_ENV) {
111     INSTALLER_ARCHIVE = $$OUT_PWD/$${BASENAME}-installer-archive.7z
112 } else {
113     INSTALLER_ARCHIVE = $$OUT_PWD/$$(INSTALLER_ARCHIVE)
114 }
115
116 #bindist.depends = deployqt
117 bindist.commands = 7z a -mx9 $$OUT_PWD/$${BASENAME}.7z \"$$BINDIST_SOURCE\"
118 #bindist_installer.depends = deployqt
119 bindist_installer.commands = 7z a -mx9 $${INSTALLER_ARCHIVE} \"$$BINDIST_INSTALLER_SOURCE\"
120 installer.depends = bindist_installer
121 installer.commands = python -u $$PWD/scripts/packageIfw.py -i \"$(IFW_PATH)\" -v $${QTCREATOR_VERSION} -a \"$${INSTALLER_ARCHIVE}\" "$$INSTALLER_NAME"
122
123 macx {
124     # this should be very temporary:
125     MENU_NIB = $$(MENU_NIB_FILE)
126     isEmpty(MENU_NIB): MENU_NIB = "FATAT_SET_MENU_NIB_FILE_ENV"
127     copy_menu_nib_installer.commands = cp -R \"$$MENU_NIB\" \"$${INSTALLER_NAME}.app/Contents/Resources\"
128
129     codesign_installer.commands = codesign -s \"$(SIGNING_IDENTITY)\" $(SIGNING_FLAGS) \"$${INSTALLER_NAME}.app\"
130     dmg_installer.commands = hdiutil create -srcfolder "$${INSTALLER_NAME}.app" -volname \"Qt Creator\" -format UDBZ "$${BASENAME}-installer.dmg" -ov -scrub -size 1g -verbose
131     QMAKE_EXTRA_TARGETS += codesign_installer dmg_installer copy_menu_nib_installer
132 }
133
134 win32 {
135     deployqt.commands ~= s,/,\\\\,g
136     bindist.commands ~= s,/,\\\\,g
137     bindist_installer.commands ~= s,/,\\\\,g
138     installer.commands ~= s,/,\\\\,g
139 }
140
141 QMAKE_EXTRA_TARGETS += deployqt bindist bindist_installer installer