improved project config

This commit is contained in:
Martchus 2015-07-17 23:55:19 +02:00
parent 45501e6ba7
commit 73972ad6b6
3 changed files with 37 additions and 26 deletions

View File

@ -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 = ""
}

View File

@ -75,12 +75,12 @@ guiqtquick {
contains(DEFINES, GUI_QTQUICK) {
RESOURCES += resources/qml.qrc
}
TRANSLATIONS = translations/passwordmanager_en_US.ts \
translations/passwordmanager_de_DE.ts
translations/passwordmanager_de_DE.ts
}
include(translations.pri)
#win32:include(windowsicon.pri) TODO
win32:include(windowsicon.pri)
OTHER_FILES += \
README.md \
@ -103,11 +103,19 @@ CONFIG(debug, debug|release) {
INCLUDEPATH += ../
# installs
target.path = $$(INSTALL_ROOT)/bin
INSTALLS += target
icon.path = $$(INSTALL_ROOT)/share/icons/hicolor/scalable/apps/
icon.files = $${PWD}/resources/icons/hicolor/scalable/apps/$${projectname}.svg
INSTALLS += icon
menu.path = $$(INSTALL_ROOT)/share/applications/
menu.files = $${PWD}/resources/desktop/applications/$${projectname}.desktop
INSTALLS += menu
mingw-w64-install {
target.path = $$(INSTALL_ROOT)
target.extra = install -m755 -D $${OUT_PWD}/release/$(TARGET) $$(INSTALL_ROOT)/bin/$(TARGET)
INSTALLS += target
} else {
target.path = $$(INSTALL_ROOT)/bin
INSTALLS += target
}
!mingw-w64-install {
icon.path = $$(INSTALL_ROOT)/share/icons/hicolor/scalable/apps/
icon.files = $${PWD}/resources/icons/hicolor/scalable/apps/$${projectname}.svg
INSTALLS += icon
menu.path = $$(INSTALL_ROOT)/share/applications/
menu.files = $${PWD}/resources/desktop/applications/$${projectname}.desktop
INSTALLS += menu
}

View File

@ -1,16 +1,15 @@
!isEmpty(TRANSLATIONS) {
isEmpty(QMAKE_LRELEASE) {
QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
isEmpty(lreleasepath) {
lreleasepath = $$[QT_HOST_BINS]/lrelease
}
isEmpty(TS_DIR):TS_DIR = translations
genqm.name = translations
genqm.input = TRANSLATIONS
genqm.output = $${OUT_PWD}/$$TS_DIR/${QMAKE_FILE_BASE}.qm
genqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $${OUT_PWD}/$$TS_DIR/${QMAKE_FILE_BASE}.qm
genqm.output = $${OUT_PWD}/translations/${QMAKE_FILE_BASE}.qm
genqm.commands = $$lreleasepath ${QMAKE_FILE_IN} -qm $${OUT_PWD}/translations/${QMAKE_FILE_BASE}.qm
genqm.CONFIG = no_link
QMAKE_EXTRA_COMPILERS += genqm
PRE_TARGETDEPS += compiler_genqm_make_all
translations.path = $$(INSTALL_ROOT)/share/$${projectname}/translations/
translations.files = $${OUT_PWD}/translations/*.qm
translations.extra = install -m644 -D $${OUT_PWD}/translations/*.qm $$(INSTALL_ROOT)/share/$${projectname}/translations/
INSTALLS += translations
}