improved project config
This commit is contained in:
parent
45501e6ba7
commit
73972ad6b6
22
general.pri
22
general.pri
|
@ -13,21 +13,14 @@ unix {
|
||||||
}
|
}
|
||||||
# prefix
|
# prefix
|
||||||
targetprefix = $$(TARGET_PREFIX)
|
targetprefix = $$(TARGET_PREFIX)
|
||||||
equals(targetprefix, "") {
|
|
||||||
win32 {
|
|
||||||
targetprefix = ../../..
|
|
||||||
} else {
|
|
||||||
targetprefix = ../..
|
|
||||||
}
|
|
||||||
}
|
|
||||||
message("Using target prefix \"$${targetprefix}\".")
|
message("Using target prefix \"$${targetprefix}\".")
|
||||||
# print install root
|
# print install root
|
||||||
message("Using install root \"$$(INSTALL_ROOT)\".")
|
message("Using install root \"$$(INSTALL_ROOT)\".")
|
||||||
# target
|
# target
|
||||||
CONFIG(debug, debug|release) {
|
CONFIG(debug, debug|release) {
|
||||||
TARGET = $$targetprefix/$${projectname}d
|
TARGET = $${targetprefix}$${projectname}d
|
||||||
} else {
|
} else {
|
||||||
TARGET = $$targetprefix/$$projectname
|
TARGET = $${targetprefix}$${projectname}
|
||||||
}
|
}
|
||||||
# variables to check target architecture
|
# variables to check target architecture
|
||||||
win32-g++:QMAKE_TARGET.arch = $$QMAKE_HOST.arch
|
win32-g++:QMAKE_TARGET.arch = $$QMAKE_HOST.arch
|
||||||
|
@ -79,3 +72,14 @@ guiqtwidgets {
|
||||||
DEFINES += GUI_QTWIDGETS
|
DEFINES += GUI_QTWIDGETS
|
||||||
DEFINES += MODEL_UNDO_SUPPORT
|
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 = ""
|
||||||
|
}
|
||||||
|
|
|
@ -75,12 +75,12 @@ guiqtquick {
|
||||||
contains(DEFINES, GUI_QTQUICK) {
|
contains(DEFINES, GUI_QTQUICK) {
|
||||||
RESOURCES += resources/qml.qrc
|
RESOURCES += resources/qml.qrc
|
||||||
}
|
}
|
||||||
|
|
||||||
TRANSLATIONS = translations/passwordmanager_en_US.ts \
|
TRANSLATIONS = translations/passwordmanager_en_US.ts \
|
||||||
translations/passwordmanager_de_DE.ts
|
translations/passwordmanager_de_DE.ts
|
||||||
}
|
}
|
||||||
include(translations.pri)
|
include(translations.pri)
|
||||||
#win32:include(windowsicon.pri) TODO
|
|
||||||
|
win32:include(windowsicon.pri)
|
||||||
|
|
||||||
OTHER_FILES += \
|
OTHER_FILES += \
|
||||||
README.md \
|
README.md \
|
||||||
|
@ -103,11 +103,19 @@ CONFIG(debug, debug|release) {
|
||||||
INCLUDEPATH += ../
|
INCLUDEPATH += ../
|
||||||
|
|
||||||
# installs
|
# installs
|
||||||
target.path = $$(INSTALL_ROOT)/bin
|
mingw-w64-install {
|
||||||
INSTALLS += target
|
target.path = $$(INSTALL_ROOT)
|
||||||
icon.path = $$(INSTALL_ROOT)/share/icons/hicolor/scalable/apps/
|
target.extra = install -m755 -D $${OUT_PWD}/release/$(TARGET) $$(INSTALL_ROOT)/bin/$(TARGET)
|
||||||
icon.files = $${PWD}/resources/icons/hicolor/scalable/apps/$${projectname}.svg
|
INSTALLS += target
|
||||||
INSTALLS += icon
|
} else {
|
||||||
menu.path = $$(INSTALL_ROOT)/share/applications/
|
target.path = $$(INSTALL_ROOT)/bin
|
||||||
menu.files = $${PWD}/resources/desktop/applications/$${projectname}.desktop
|
INSTALLS += target
|
||||||
INSTALLS += menu
|
}
|
||||||
|
!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
|
||||||
|
}
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
!isEmpty(TRANSLATIONS) {
|
!isEmpty(TRANSLATIONS) {
|
||||||
isEmpty(QMAKE_LRELEASE) {
|
isEmpty(lreleasepath) {
|
||||||
QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
|
lreleasepath = $$[QT_HOST_BINS]/lrelease
|
||||||
}
|
}
|
||||||
isEmpty(TS_DIR):TS_DIR = translations
|
|
||||||
genqm.name = translations
|
genqm.name = translations
|
||||||
genqm.input = TRANSLATIONS
|
genqm.input = TRANSLATIONS
|
||||||
genqm.output = $${OUT_PWD}/$$TS_DIR/${QMAKE_FILE_BASE}.qm
|
genqm.output = $${OUT_PWD}/translations/${QMAKE_FILE_BASE}.qm
|
||||||
genqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $${OUT_PWD}/$$TS_DIR/${QMAKE_FILE_BASE}.qm
|
genqm.commands = $$lreleasepath ${QMAKE_FILE_IN} -qm $${OUT_PWD}/translations/${QMAKE_FILE_BASE}.qm
|
||||||
genqm.CONFIG = no_link
|
genqm.CONFIG = no_link
|
||||||
QMAKE_EXTRA_COMPILERS += genqm
|
QMAKE_EXTRA_COMPILERS += genqm
|
||||||
PRE_TARGETDEPS += compiler_genqm_make_all
|
PRE_TARGETDEPS += compiler_genqm_make_all
|
||||||
translations.path = $$(INSTALL_ROOT)/share/$${projectname}/translations/
|
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
|
INSTALLS += translations
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue