2013-10-07 01:41:37 +00:00
|
|
|
marbledir.files = $$MARBLEDIR
|
|
|
|
xslt.files = $$XSLT_FILES
|
|
|
|
doc.files = $$DOC_FILES
|
2013-10-10 18:44:29 +00:00
|
|
|
translation.files = $$replace(TRANSLATIONS, .ts, .qm)
|
2013-10-07 01:41:37 +00:00
|
|
|
|
|
|
|
nltab = $$escape_expand(\\n\\t)
|
|
|
|
|
|
|
|
mac {
|
|
|
|
# OS X bundling rules
|
|
|
|
# "make mac-deploy" deploys the external libs (Qt, libdivecomputer, libusb, etc.) into the bundle
|
2013-10-09 20:42:37 +00:00
|
|
|
# "make install" installs the bundle to /Applications
|
2013-10-07 01:41:37 +00:00
|
|
|
# "make mac-create-dmg" creates Subsurface.dmg
|
|
|
|
|
2013-10-09 20:42:37 +00:00
|
|
|
mac_bundle.path = /Applications
|
2013-10-07 01:41:37 +00:00
|
|
|
mac_bundle.files = Subsurface.app
|
|
|
|
mac_bundle.CONFIG += no_check_exist directory
|
|
|
|
INSTALLS += mac_bundle
|
|
|
|
install.depends += mac-deploy
|
|
|
|
|
2013-10-10 18:44:29 +00:00
|
|
|
datadir = Contents/Resources/share
|
2013-10-07 01:41:37 +00:00
|
|
|
marbledir.path = Contents/Resources/data
|
|
|
|
xslt.path = $$datadir
|
2013-10-10 18:44:29 +00:00
|
|
|
doc.path = $$datadir/doc
|
|
|
|
translation.path = Contents/Resources/translations
|
2013-10-07 01:41:37 +00:00
|
|
|
doc.files = $$files($$doc.files)
|
2013-10-10 18:44:29 +00:00
|
|
|
QMAKE_BUNDLE_DATA += marbledir xslt doc translation
|
2013-10-07 01:41:37 +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}-$${VERSION}.dmg
|
|
|
|
QMAKE_EXTRA_TARGETS += mac_deploy mac_dmg
|
|
|
|
} else: win32 {
|
|
|
|
# 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
|
|
|
|
WINDOWSSTAGING = packaging/windows
|
|
|
|
|
|
|
|
deploy.path = $$WINDOWSSTAGING
|
2013-10-09 04:40:24 +00:00
|
|
|
deploy.files += $$xslt.files $$doc.files
|
2013-10-07 01:41:37 +00:00
|
|
|
target.path = $$WINDOWSSTAGING
|
2013-10-09 04:40:24 +00:00
|
|
|
marbledir.path = $$WINDOWSSTAGING/data
|
|
|
|
INSTALLS += deploy marbledir target
|
2013-10-07 01:41:37 +00:00
|
|
|
|
|
|
|
qt_conf.commands = echo \'[Paths]\' > $@
|
|
|
|
qt_conf.commands += $${nltab}echo \'Prefix=.\' >> $@
|
2013-10-09 04:27:10 +00:00
|
|
|
qt_conf.commands += $${nltab}echo \'Plugins=.\' >> $@
|
2013-10-07 01:41:37 +00:00
|
|
|
qt_conf.target = $$PWD/packaging/windows/qt.conf
|
|
|
|
install.depends += qt_conf
|
2013-10-09 00:47:25 +00:00
|
|
|
|
|
|
|
!win32-msvc* {
|
2013-10-11 18:05:37 +00:00
|
|
|
#!equals($$QMAKE_HOST.os, "Windows"): dlls.commands += OBJDUMP=`$$QMAKE_CC -dumpmachine`-objdump
|
2013-10-11 18:05:38 +00:00
|
|
|
dlls.commands += PATH=\$\$PATH:`$$QMAKE_CC -print-search-dirs | sed -nE \'/^libraries: =/{s///;s,/lib/?(:|\$\$),/bin\\1,g;p;q;}\'`
|
2013-10-11 18:05:39 +00:00
|
|
|
dlls.commands += perl $$PWD/scripts/win-ldd.pl \$^
|
2013-10-09 04:27:10 +00:00
|
|
|
|
|
|
|
for(plugin, $$list($$DEPLOYMENT_PLUGIN)) {
|
2013-10-11 18:05:39 +00:00
|
|
|
CONFIG(debug, debug|release): dlls.depends += $$[QT_INSTALL_PLUGINS]/$${plugin}d4.dll
|
|
|
|
else: dlls.depends += $$[QT_INSTALL_PLUGINS]/$${plugin}4.dll
|
2013-10-09 04:27:10 +00:00
|
|
|
}
|
|
|
|
|
2013-10-09 00:47:25 +00:00
|
|
|
dlls.commands += $$LIBS
|
|
|
|
dlls.commands += | while read name; do $(INSTALL_FILE) \$\$name $$PWD/$$WINDOWSSTAGING; done
|
2013-10-11 18:05:39 +00:00
|
|
|
dlls.depends += $(DESTDIR_TARGET)
|
2013-10-09 00:47:25 +00:00
|
|
|
install.depends += dlls
|
|
|
|
}
|
2013-10-07 01:41:37 +00:00
|
|
|
} else {
|
|
|
|
# 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
|
|
|
|
nl = $$escape_expand(\\n)
|
|
|
|
dummy.target = dummy-only-for-var-expansion
|
|
|
|
dummy.commands = $${nl}prefix = /usr$${nl}\
|
|
|
|
BINDIR = $(prefix)/bin$${nl}\
|
|
|
|
DATADIR = $(prefix)/share$${nl}\
|
|
|
|
DOCDIR = $(DATADIR)/doc/subsurface$${nl}\
|
|
|
|
DESKTOPDIR = $(DATADIR)/applications$${nl}\
|
|
|
|
ICONPATH = $(DATADIR)/icons/hicolor$${nl}\
|
|
|
|
ICONDIR = $(ICONPATH)/scalable/apps$${nl}\
|
|
|
|
MANDIR = $(DATADIR)/man/man1$${nl}\
|
|
|
|
XSLTDIR = $(DATADIR)/subsurface
|
|
|
|
QMAKE_EXTRA_TARGETS += dummy
|
|
|
|
|
|
|
|
WINDOWSSTAGING = ./packaging/windows
|
|
|
|
|
|
|
|
target.path = /$(BINDIR)
|
|
|
|
target.files = $$TARGET
|
|
|
|
|
|
|
|
desktop.path = /$(DESKTOPDIR)
|
|
|
|
desktop.files = $$DESKTOP_FILE
|
|
|
|
manpage.path = /$(MANDIR)
|
|
|
|
manpage.files = $$MANPAGE
|
|
|
|
|
|
|
|
icon.path = /$(ICONDIR)
|
|
|
|
icon.files = $$ICON
|
|
|
|
|
|
|
|
xslt.path = /$(XSLTDIR)
|
|
|
|
marbledir.path = /$(DATADIR)/subsurface
|
|
|
|
doc.path = /$(DOCDIR)
|
|
|
|
|
|
|
|
# FIXME: Linguist translations
|
|
|
|
#l10n_install.commands = for LOC in $$files(share/locale/*/LC_MESSAGES); do \
|
|
|
|
# $(INSTALL_PROGRAM) -d $(INSTALL_ROOT)/$(prefix)/$$LOC; \
|
|
|
|
# $(INSTALL_FILE) $$LOC/subsurface.mo $(INSTALL_ROOT)/$(prefix)/$$LOC/subsurface.mo; \
|
|
|
|
# done
|
|
|
|
#install.depends += l10n_install
|
|
|
|
|
|
|
|
INSTALLS += target desktop icon manpage xslt doc marbledir
|
|
|
|
install.target = install
|
|
|
|
}
|
2013-10-10 19:39:01 +00:00
|
|
|
!isEmpty(TRANSLATIONS) {
|
|
|
|
isEmpty(QMAKE_LRELEASE) {
|
|
|
|
win32: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
|
|
|
|
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
|