mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add qmake rules to install Subsurface
This is probably the most complex part of the new buildsystem. This adds the following targets: - Linux: make install - installs to $(prefix) (default: /usr) The install path can be changed during make install time. - Windows: make install - installs Subsurface and its dependencies to packaging/windows. - Mac: make mac-deploy - populates Subsurface.app with the dependencies make install - mac-deploy + install Subsurface.app to /Application make mac-create-dmg - mac-deploy + creates Subsurface-$VERSION.dmg Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
parent
1e7db5f77f
commit
9e069371c6
2 changed files with 112 additions and 0 deletions
102
subsurface-install.pri
Normal file
102
subsurface-install.pri
Normal file
|
@ -0,0 +1,102 @@
|
|||
marbledir.files = $$MARBLEDIR
|
||||
xslt.files = $$XSLT_FILES
|
||||
doc.files = $$DOC_FILES
|
||||
|
||||
nltab = $$escape_expand(\\n\\t)
|
||||
|
||||
mac {
|
||||
# OS X bundling rules
|
||||
# "make mac-deploy" deploys the external libs (Qt, libdivecomputer, libusb, etc.) into the bundle
|
||||
# "make install" installs the bundle to /Application
|
||||
# "make mac-create-dmg" creates Subsurface.dmg
|
||||
|
||||
mac_bundle.path = /Application
|
||||
mac_bundle.files = Subsurface.app
|
||||
mac_bundle.CONFIG += no_check_exist directory
|
||||
INSTALLS += mac_bundle
|
||||
install.depends += mac-deploy
|
||||
|
||||
datadir = Contents/Resources/share/subsurface
|
||||
marbledir.path = Contents/Resources/data
|
||||
xslt.path = $$datadir
|
||||
doc.path = Contents/Resources/share/doc/subsurface
|
||||
doc.files = $$files($$doc.files)
|
||||
QMAKE_BUNDLE_DATA += marbledir xslt doc
|
||||
|
||||
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
|
||||
for(qtlib, $$list(QtCore QtGui QtNetwork QtWebKit QtSvg QtXml QtDeclarative)) {
|
||||
CONFIG(debug, debug|release): deploy.files += $$[QT_INSTALL_BINS]/$${qtlib}d4.dll
|
||||
else: deploy.files += $$[QT_INSTALL_BINS]/$${qtlib}4.dll
|
||||
}
|
||||
|
||||
deploy.files += $$marbledir.files $$xslt.files $$doc.files
|
||||
target.path = $$WINDOWSSTAGING
|
||||
INSTALLS += deploy target
|
||||
|
||||
qt_conf.commands = echo \'[Paths]\' > $@
|
||||
qt_conf.commands += $${nltab}echo \'Prefix=.\' >> $@
|
||||
qt_conf.commands += $${nltab}echo \'Plugins=plugins\' >> $@
|
||||
qt_conf.target = $$PWD/packaging/windows/qt.conf
|
||||
install.depends += qt_conf
|
||||
} 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
|
||||
}
|
||||
QMAKE_EXTRA_TARGETS += install $$install.depends
|
|
@ -126,4 +126,14 @@ doc.commands += $$escape_expand(\\n\\t)$(MAKE) -C $$PWD/Documentation OUT=$$OUT_
|
|||
all.depends += doc
|
||||
QMAKE_EXTRA_TARGETS += doc all
|
||||
|
||||
DESKTOP_FILE = subsurface.desktop
|
||||
ICON = subsurface-icon.svg
|
||||
MANPAGE = subsurface.1
|
||||
XSLT_FILES = xslt/*.xslt xslt/*.xsl
|
||||
DOC_FILES = $$OUT_PWD/Documentation/user-manual.html Documentation/images
|
||||
MARBLEDIR = marbledata/maps
|
||||
|
||||
OTHER_FILES += $$DESKTOPFILE $$ICON $$MANPAGE $$XSLT_FILES $$DOC_FILES $$MARBLEDIR
|
||||
|
||||
include(subsurface-gen-version.pri)
|
||||
include(subsurface-install.pri)
|
||||
|
|
Loading…
Add table
Reference in a new issue