From d4617803691c3193fb0a898fa39b0688379e17cd Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 21 Apr 2014 11:09:07 -0700 Subject: [PATCH] Windows out of tree cross build: stage package in correct folder When doing an out of tree build you don't want to stage the package with the source but under your current directory. So let's make sure we distinguish between source and target here... and instead of putting things into packaging/windows they now end up in staging which is much more consistent. And to make my life even easier, the installer .exe ends up in the base dir in which you build the package. Also, we link statically against libdivecomputer, so don't pack the dll. Signed-off-by: Dirk Hohndel --- packaging/windows/subsurface.nsi.in | 5 ++--- subsurface-install.pri | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packaging/windows/subsurface.nsi.in b/packaging/windows/subsurface.nsi.in index 1a718a2bf..24b502ff9 100644 --- a/packaging/windows/subsurface.nsi.in +++ b/packaging/windows/subsurface.nsi.in @@ -26,7 +26,7 @@ # Installer name and filename Name "Subsurface" Caption "Subsurface ${SUBSURFACE_VERSION} Setup" - OutFile "subsurface-${SUBSURFACE_VERSION}.exe" + OutFile "..\subsurface-${SUBSURFACE_VERSION}.exe" # Icon to use for the installer !define MUI_ICON "subsurface.ico" @@ -70,7 +70,7 @@ # Pages # Installer pages - !insertmacro MUI_PAGE_LICENSE "..\..\gpl-2.0.txt" + !insertmacro MUI_PAGE_LICENSE "gpl-2.0.txt" !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder !insertmacro MUI_PAGE_INSTFILES @@ -105,7 +105,6 @@ Section File /r Documentation File /r translations File iconv.dll - File libdivecomputer-0.dll File libpng16-16.dll File libjpeg-*.dll File libusb-1.0.dll diff --git a/subsurface-install.pri b/subsurface-install.pri index 2dcb98113..c53f91123 100644 --- a/subsurface-install.pri +++ b/subsurface-install.pri @@ -48,9 +48,10 @@ mac { # 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 - NSIFILE = $$PWD/$$WINDOWSSTAGING/subsurface.nsi - NSIINPUTFILE = $$PWD/$$WINDOWSSTAGING/subsurface.nsi.in + WINDOWSSTAGING = $$OUT_PWD/staging + WINDOWSPACKAGING = $$PWD/packaging/windows + NSIFILE = $$WINDOWSSTAGING/subsurface.nsi + NSIINPUTFILE = $$WINDOWSPACKAGING/subsurface.nsi.in MAKENSIS = /usr/bin/makensis doc.path = $$WINDOWSSTAGING/Documentation @@ -63,11 +64,13 @@ mac { translation.path = $$WINDOWSSTAGING/translations qttranslation.path = $$WINDOWSSTAGING/translations - INSTALLS += translation qttranslation + package.files = $$PWD/gpl-2.0.txt $$WINDOWSPACKAGING/subsurface.ico + package.path = $$WINDOWSSTAGING + INSTALLS += translation qttranslation package qt_conf.commands = echo \'[Paths]\' > $@ qt_conf.commands += $${nltab}echo \'Prefix=.\' >> $@ - qt_conf.target = $$PWD/packaging/windows/qt.conf + qt_conf.target = $$WINDOWSSTAGING/qt.conf install.depends += qt_conf # Plugin code @@ -108,9 +111,10 @@ mac { else: dlls.commands += $$OUT_PWD/release/$$TARGET$$EXE_SUFFIX dlls.commands += $$ABS_DEPLOYMENT_PLUGIN $$LIBS - dlls.commands += | while read name; do $(INSTALL_FILE) \$\$name $$PWD/$$WINDOWSSTAGING; done + dlls.commands += | while read name; do $(INSTALL_FILE) \$\$name $$WINDOWSSTAGING; done dlls.depends += $(DESTDIR_TARGET) + nsis.commands += $(CHK_DIR_EXISTS) $$WINDOWSSTAGING; nsis.commands += cat $$NSIINPUTFILE | sed -e \'s/VERSIONTOKEN/$$VERSION_STRING/;s/PRODVTOKEN/$${PRODVERSION_STRING}/\' > $$NSIFILE nsis.depends += $$NSIINPUTFILE nsis.target = $$NSISFILE @@ -143,8 +147,6 @@ mac { QMAKE_EXTRA_TARGETS += dummy - WINDOWSSTAGING = ./packaging/windows - target.path = /$(EXPORT_BINDIR) target.files = $$TARGET