From a59ac8e0d63f12c877dafc60dab9d88d09c5a1f1 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 18 Jul 2015 00:41:58 +0200 Subject: [PATCH] improved project config --- general.pri | 22 +++++++++++++--------- passwordfile.pro | 21 ++++++++++++++------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/general.pri b/general.pri index 9f790b4..81b63cd 100644 --- a/general.pri +++ b/general.pri @@ -13,21 +13,14 @@ unix { } # prefix targetprefix = $$(TARGET_PREFIX) -equals(targetprefix, "") { - win32 { - targetprefix = ../../.. - } else { - targetprefix = ../.. - } -} message("Using target prefix \"$${targetprefix}\".") # print install root message("Using install root \"$$(INSTALL_ROOT)\".") # target CONFIG(debug, debug|release) { - TARGET = $$targetprefix/$${projectname}d + TARGET = $${targetprefix}$${projectname}d } else { - TARGET = $$targetprefix/$$projectname + TARGET = $${targetprefix}$${projectname} } # variables to check target architecture win32-g++:QMAKE_TARGET.arch = $$QMAKE_HOST.arch @@ -79,3 +72,14 @@ guiqtwidgets { DEFINES += GUI_QTWIDGETS DEFINES += MODEL_UNDO_SUPPORT } +# configuration for cross compliation with mingw-w64 +mingw-w64-manualstrip-dll { + QMAKE_POST_LINK=$${CROSS_COMPILE}strip --strip-unneeded ./release/$(TARGET); \ + $${CROSS_COMPILE}strip --strip-unneeded ./release/lib$(TARGET).a +} +mingw-w64-manualstrip-exe { + QMAKE_POST_LINK=$${CROSS_COMPILE}strip --strip-unneeded ./release/$(TARGET) +} +mingw-w64-noversion { + VERSION = "" +} diff --git a/passwordfile.pro b/passwordfile.pro index abca3f1..105a827 100644 --- a/passwordfile.pro +++ b/passwordfile.pro @@ -66,13 +66,20 @@ LIBS += -lz INCLUDEPATH += ../ # installs -!android { +mingw-w64-install { + target.path = $$(INSTALL_ROOT) + target.extra = install -m755 -D $${OUT_PWD}/release/lib$(TARGET).a $$(INSTALL_ROOT)/lib/lib$(TARGET).a + INSTALLS += target + dlltarget.path = $$(INSTALL_ROOT) + dlltarget.extra = install -m755 -D $${OUT_PWD}/release/$(TARGET) $$(INSTALL_ROOT)/bin/$(TARGET) + INSTALLS += dlltarget +} else { target.path = $$(INSTALL_ROOT)/lib INSTALLS += target - for(dir, $$list(io util)) { - eval(inc_$${dir} = $${dir}) - inc_$${dir}.path = $$(INSTALL_ROOT)/include/$$projectname/$${dir} - inc_$${dir}.files = $${dir}/*.h - INSTALLS += inc_$${dir} - } +} +for(dir, $$list(io util)) { + eval(inc_$${dir} = $${dir}) + inc_$${dir}.path = $$(INSTALL_ROOT)/include/$$projectname/$${dir} + inc_$${dir}.files = $${dir}/*.h + INSTALLS += inc_$${dir} }