2013-12-06 00:00:06 +00:00
|
|
|
marbledir.files = $$MARBLEDIR
|
2013-10-07 01:41:37 +00:00
|
|
|
doc.files = $$DOC_FILES
|
2014-06-01 04:48:26 +00:00
|
|
|
theme.files = $$THEME_FILES
|
2013-10-10 18:44:29 +00:00
|
|
|
translation.files = $$replace(TRANSLATIONS, .ts, .qm)
|
2013-12-06 00:01:11 +00:00
|
|
|
exists($$[QT_INSTALL_TRANSLATIONS]) {
|
2014-01-21 22:55:21 +00:00
|
|
|
qt_translation_dir = $$[QT_INSTALL_TRANSLATIONS]
|
2014-08-02 22:06:10 +00:00
|
|
|
} else: exists(/usr/share/qt5/translations) {
|
2013-12-06 00:01:11 +00:00
|
|
|
# On some cross-compilation environments, the translations are either missing or not
|
|
|
|
# where they're expected to be. In such cases, try copying from the system.
|
2014-08-02 22:06:10 +00:00
|
|
|
qt_translation_dir = /usr/share/qt5/translations
|
2013-12-06 00:01:11 +00:00
|
|
|
}
|
2014-01-21 22:55:21 +00:00
|
|
|
|
|
|
|
# Prepend the Qt translation dir so we can actually find the files
|
|
|
|
qttranslation.files =
|
|
|
|
for(translation, QTTRANSLATIONS): \
|
|
|
|
qttranslation.files += $${qt_translation_dir}/$$translation
|
2013-10-07 01:41:37 +00:00
|
|
|
|
|
|
|
nltab = $$escape_expand(\\n\\t)
|
|
|
|
|
|
|
|
mac {
|
2013-12-03 21:00:22 +00:00
|
|
|
# OS X bundling rules
|
|
|
|
# "make mac-deploy" deploys the external libs (Qt, libdivecomputer, libusb, etc.) into the bundle
|
|
|
|
# "make install" installs the bundle to /Applications
|
|
|
|
# "make mac-create-dmg" creates Subsurface.dmg
|
|
|
|
|
|
|
|
mac_bundle.path = /Applications
|
|
|
|
mac_bundle.files = Subsurface.app
|
|
|
|
mac_bundle.CONFIG += no_check_exist directory
|
|
|
|
INSTALLS += mac_bundle
|
|
|
|
install.depends += mac-deploy
|
|
|
|
|
|
|
|
datadir = Contents/Resources/share
|
|
|
|
marbledir.path = Contents/Resources/data
|
2014-06-08 14:54:11 +00:00
|
|
|
theme.path = Contents/Resources
|
2013-12-15 17:45:30 +00:00
|
|
|
doc.path = $$datadir/Documentation
|
2013-12-03 21:00:22 +00:00
|
|
|
translation.path = Contents/Resources/translations
|
|
|
|
qttranslation.path = Contents/Resources/translations
|
2014-06-05 23:26:35 +00:00
|
|
|
QMAKE_BUNDLE_DATA += marbledir doc translation qttranslation theme
|
2013-12-03 21:00:22 +00:00
|
|
|
|
|
|
|
mac_deploy.target = mac-deploy
|
|
|
|
mac_deploy.commands += $$[QT_INSTALL_BINS]/macdeployqt $${TARGET}.app
|
|
|
|
!isEmpty(V):mac_deploy.commands += -verbose=1
|
|
|
|
|
|
|
|
mac_dmg.target = mac-create-dmg
|
|
|
|
mac_dmg.commands = $$mac_deploy.commands -dmg
|
|
|
|
mac_dmg.commands += $${nltab}$(MOVE) $${TARGET}.dmg $${TARGET}-$${FULL_VERSION}.dmg
|
|
|
|
QMAKE_EXTRA_TARGETS += mac_deploy mac_dmg
|
2013-10-07 01:41:37 +00:00
|
|
|
} else: win32 {
|
2013-12-03 21:00:22 +00:00
|
|
|
# Windows bundling rules
|
|
|
|
# We don't have a helpful tool like macdeployqt for Windows, so we hardcode
|
|
|
|
# which libs we need.
|
|
|
|
# The only target is "make install", which copies everything into packaging/windows
|
2014-04-21 18:09:07 +00:00
|
|
|
WINDOWSSTAGING = $$OUT_PWD/staging
|
|
|
|
WINDOWSPACKAGING = $$PWD/packaging/windows
|
|
|
|
NSIFILE = $$WINDOWSSTAGING/subsurface.nsi
|
|
|
|
NSIINPUTFILE = $$WINDOWSPACKAGING/subsurface.nsi.in
|
2013-12-03 21:00:22 +00:00
|
|
|
MAKENSIS = /usr/bin/makensis
|
|
|
|
|
2013-12-07 05:42:18 +00:00
|
|
|
doc.path = $$WINDOWSSTAGING/Documentation
|
2013-12-05 23:34:09 +00:00
|
|
|
CONFIG -= copy_dir_files
|
2013-12-03 21:00:22 +00:00
|
|
|
deploy.path = $$WINDOWSSTAGING
|
|
|
|
deploy.CONFIG += no_check_exist
|
|
|
|
target.path = $$WINDOWSSTAGING
|
|
|
|
marbledir.path = $$WINDOWSSTAGING/data
|
2014-06-08 14:54:11 +00:00
|
|
|
theme.path = $$WINDOWSSTAGING
|
2014-06-05 23:26:35 +00:00
|
|
|
INSTALLS += deploy marbledir target doc theme
|
2013-12-03 21:00:22 +00:00
|
|
|
|
2013-12-06 00:01:11 +00:00
|
|
|
translation.path = $$WINDOWSSTAGING/translations
|
|
|
|
qttranslation.path = $$WINDOWSSTAGING/translations
|
2014-04-21 18:09:07 +00:00
|
|
|
package.files = $$PWD/gpl-2.0.txt $$WINDOWSPACKAGING/subsurface.ico
|
|
|
|
package.path = $$WINDOWSSTAGING
|
|
|
|
INSTALLS += translation qttranslation package
|
2013-12-06 00:01:11 +00:00
|
|
|
|
2013-12-03 21:00:22 +00:00
|
|
|
qt_conf.commands = echo \'[Paths]\' > $@
|
|
|
|
qt_conf.commands += $${nltab}echo \'Prefix=.\' >> $@
|
2014-04-21 18:09:07 +00:00
|
|
|
qt_conf.target = $$WINDOWSSTAGING/qt.conf
|
2013-12-03 21:00:22 +00:00
|
|
|
install.depends += qt_conf
|
|
|
|
|
|
|
|
# Plugin code
|
|
|
|
defineTest(deployPlugin) {
|
|
|
|
plugin = $$1
|
|
|
|
plugintype = $$dirname(1)
|
|
|
|
CONFIG(debug, debug|release): plugin = $${plugin}d4.dll
|
|
|
|
else: plugin = $${plugin}4.dll
|
|
|
|
|
|
|
|
abs_plugin = $$[QT_INSTALL_PLUGINS]/$$plugin
|
|
|
|
ABS_DEPLOYMENT_PLUGIN += $$abs_plugin
|
|
|
|
export(ABS_DEPLOYMENT_PLUGIN)
|
|
|
|
|
|
|
|
safe_name = $$replace(1, /, _)
|
|
|
|
INSTALLS += $$safe_name
|
|
|
|
|
|
|
|
# Work around qmake bug in Qt4 that it can't handle $${xx}.yy properly
|
|
|
|
eval(safe_name_files = $${safe_name}.files)
|
|
|
|
eval(safe_name_path = $${safe_name}.path)
|
|
|
|
$$safe_name_files = $$abs_plugin
|
|
|
|
$$safe_name_path = $$WINDOWSSTAGING/plugins/$$plugintype
|
|
|
|
export($$safe_name_files)
|
|
|
|
export($$safe_name_path)
|
|
|
|
export(INSTALLS)
|
|
|
|
}
|
|
|
|
# Convert plugin names to the relative DLL path
|
|
|
|
for(plugin, $$list($$DEPLOYMENT_PLUGIN)) {
|
|
|
|
deployPlugin($$plugin)
|
|
|
|
}
|
|
|
|
|
|
|
|
!win32-msvc* {
|
|
|
|
#!equals($$QMAKE_HOST.os, "Windows"): dlls.commands += OBJDUMP=`$$QMAKE_CC -dumpmachine`-objdump
|
|
|
|
dlls.commands += PATH=\$\$PATH:`$$QMAKE_CC -print-search-dirs | sed -nE \'/^libraries: =/{s///;s,/lib/?(:|\$\$),/bin\\1,g;p;q;}\'`
|
|
|
|
dlls.commands += perl $$PWD/scripts/win-ldd.pl
|
|
|
|
# equals(QMAKE_HOST.os, "Windows"): EXE_SUFFIX = .exe
|
|
|
|
EXE_SUFFIX = .exe
|
|
|
|
CONFIG(debug, debug|release): dlls.commands += $$OUT_PWD/debug/subsurface$$EXE_SUFFIX
|
|
|
|
else: dlls.commands += $$OUT_PWD/release/$$TARGET$$EXE_SUFFIX
|
|
|
|
|
|
|
|
dlls.commands += $$ABS_DEPLOYMENT_PLUGIN $$LIBS
|
2014-04-21 18:09:07 +00:00
|
|
|
dlls.commands += | while read name; do $(INSTALL_FILE) \$\$name $$WINDOWSSTAGING; done
|
2013-12-03 21:00:22 +00:00
|
|
|
dlls.depends += $(DESTDIR_TARGET)
|
|
|
|
|
2014-04-21 18:09:07 +00:00
|
|
|
nsis.commands += $(CHK_DIR_EXISTS) $$WINDOWSSTAGING;
|
2014-10-29 18:24:43 +00:00
|
|
|
win64target {
|
|
|
|
nsis.commands += cat $$NSIINPUTFILE | sed -e \'s/VERSIONTOKEN/$$VERSION_STRING/;s/PRODVTOKEN/$${PRODVERSION_STRING}/;s/64BITBUILDTOKEN/1 == 1/\' > $$NSIFILE
|
|
|
|
} else {
|
|
|
|
nsis.commands += cat $$NSIINPUTFILE | sed -e \'s/VERSIONTOKEN/$$VERSION_STRING/;s/PRODVTOKEN/$${PRODVERSION_STRING}/;s/64BITBUILDTOKEN/1 == 0/\' > $$NSIFILE
|
|
|
|
}
|
2013-12-03 21:00:22 +00:00
|
|
|
nsis.depends += $$NSIINPUTFILE
|
|
|
|
nsis.target = $$NSISFILE
|
|
|
|
installer.commands += $$MAKENSIS $$NSIFILE
|
|
|
|
installer.target = installer
|
|
|
|
installer.depends = nsis install
|
|
|
|
QMAKE_EXTRA_TARGETS = installer nsis
|
|
|
|
install.depends += dlls
|
|
|
|
}
|
2014-03-26 22:08:57 +00:00
|
|
|
} else: android {
|
|
|
|
# Android install rules
|
|
|
|
QMAKE_BUNDLE_DATA += translation qttranslation
|
2014-06-23 11:48:17 +00:00
|
|
|
# Android template directory
|
|
|
|
ANDROID_PACKAGE_SOURCE_DIR = $$OUT_PWD/android
|
2013-10-07 01:41:37 +00:00
|
|
|
} else {
|
2013-12-03 21:00:22 +00:00
|
|
|
# Linux install rules
|
|
|
|
# On Linux, we can count on packagers doing the right thing
|
|
|
|
# We just need to drop a few files here and there
|
|
|
|
|
|
|
|
# This is a fake rule just to create some rules in the target file
|
|
|
|
dummy.target = dummy-only-for-var-expansion
|
2014-01-28 20:14:57 +00:00
|
|
|
dummy.commands = $$escape_expand(\\n)prefix = /usr
|
|
|
|
|
|
|
|
QMAKE_EXTRA_VARIABLES = BINDIR DATADIR DOCDIR DESKTOPDIR ICONPATH ICONDIR MANDIR
|
|
|
|
BINDIR = $(prefix)/bin
|
|
|
|
DATADIR = $(prefix)/share
|
|
|
|
DOCDIR = $(EXPORT_DATADIR)/subsurface/Documentation
|
|
|
|
DESKTOPDIR = $(EXPORT_DATADIR)/applications
|
|
|
|
ICONPATH = $(EXPORT_DATADIR)/icons/hicolor
|
|
|
|
ICONDIR = $(EXPORT_ICONPATH)/scalable/apps
|
|
|
|
MANDIR = $(EXPORT_DATADIR)/man/man1
|
2013-12-17 18:11:20 +00:00
|
|
|
|
2013-12-03 21:00:22 +00:00
|
|
|
QMAKE_EXTRA_TARGETS += dummy
|
2013-10-07 01:41:37 +00:00
|
|
|
|
2014-01-28 20:14:57 +00:00
|
|
|
target.path = /$(EXPORT_BINDIR)
|
2013-12-03 21:00:22 +00:00
|
|
|
target.files = $$TARGET
|
2013-10-07 01:41:37 +00:00
|
|
|
|
2014-01-28 20:14:57 +00:00
|
|
|
desktop.path = /$(EXPORT_DESKTOPDIR)
|
2013-12-03 21:00:22 +00:00
|
|
|
desktop.files = $$DESKTOP_FILE
|
2014-01-28 20:14:57 +00:00
|
|
|
manpage.path = /$(EXPORT_MANDIR)
|
2013-12-03 21:00:22 +00:00
|
|
|
manpage.files = $$MANPAGE
|
2013-10-07 01:41:37 +00:00
|
|
|
|
2014-01-28 20:14:57 +00:00
|
|
|
icon.path = /$(EXPORT_ICONDIR)
|
2013-12-27 16:29:02 +00:00
|
|
|
icon.files = $$ICON
|
|
|
|
|
2014-01-28 20:14:57 +00:00
|
|
|
marbledir.path = /$(EXPORT_DATADIR)/subsurface/data
|
|
|
|
doc.path = /$(EXPORT_DOCDIR)
|
2014-06-01 04:48:26 +00:00
|
|
|
theme.path = /$(EXPORT_DATADIR)/subsurface
|
2013-10-07 01:41:37 +00:00
|
|
|
|
2013-12-03 21:00:22 +00:00
|
|
|
doc.CONFIG += no_check_exist
|
2013-11-14 21:26:50 +00:00
|
|
|
|
2014-01-28 20:14:57 +00:00
|
|
|
translation.path = /$(EXPORT_DATADIR)/subsurface/translations
|
2013-12-07 12:25:16 +00:00
|
|
|
translation.CONFIG += no_check_exist
|
2013-12-06 00:01:10 +00:00
|
|
|
|
2014-06-01 04:48:26 +00:00
|
|
|
INSTALLS += target desktop manpage doc marbledir translation icon theme
|
2013-12-03 21:00:22 +00:00
|
|
|
install.target = install
|
2013-10-07 01:41:37 +00:00
|
|
|
}
|
2013-10-10 19:39:01 +00:00
|
|
|
!isEmpty(TRANSLATIONS) {
|
|
|
|
isEmpty(QMAKE_LRELEASE) {
|
2013-12-03 21:00:20 +00:00
|
|
|
win32: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
|
2013-10-10 19:39:01 +00:00
|
|
|
else: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
|
|
|
|
}
|
|
|
|
isEmpty(TS_DIR):TS_DIR = translations
|
2013-10-11 16:25:46 +00:00
|
|
|
TSQM.input = TRANSLATIONS
|
2013-10-10 19:39:01 +00:00
|
|
|
TSQM.output = $$TS_DIR/${QMAKE_FILE_BASE}.qm
|
2013-10-11 16:25:46 +00:00
|
|
|
TSQM.CONFIG += no_link target_predeps
|
|
|
|
TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $$TS_DIR/${QMAKE_FILE_BASE}.qm
|
|
|
|
QMAKE_EXTRA_COMPILERS += TSQM
|
2013-10-10 19:39:01 +00:00
|
|
|
}
|
2013-10-07 01:41:37 +00:00
|
|
|
QMAKE_EXTRA_TARGETS += install $$install.depends
|