Include revision and commit hash to the version if available.
Rewritten qcma.pro file.
This commit is contained in:
110
qcma.pro
110
qcma.pro
@@ -11,6 +11,8 @@ QT += core \
|
|||||||
|
|
||||||
TARGET = qcma
|
TARGET = qcma
|
||||||
|
|
||||||
|
VERSION = 0.2.9
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
|
||||||
SOURCES += src/main.cpp \
|
SOURCES += src/main.cpp \
|
||||||
@@ -63,23 +65,6 @@ HEADERS += \
|
|||||||
src/forms/progressform.h \
|
src/forms/progressform.h \
|
||||||
src/httpdownloader.h
|
src/httpdownloader.h
|
||||||
|
|
||||||
INCLUDEPATH += src/
|
|
||||||
|
|
||||||
CONFIG += link_pkgconfig
|
|
||||||
PKGCONFIG += libvitamtp libavformat libavcodec libavutil libswscale
|
|
||||||
|
|
||||||
QMAKE_CXXFLAGS += -Wno-write-strings -Wall -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
|
|
||||||
|
|
||||||
RESOURCES += qcmares.qrc translations.qrc
|
|
||||||
|
|
||||||
OTHER_FILES += \
|
|
||||||
resources/xml/psp2-updatelist.xml \
|
|
||||||
resources/images/psv_icon.png \
|
|
||||||
resources/images/psv_icon_16.png \
|
|
||||||
resources/images/qcma.png \
|
|
||||||
resources/qcma.desktop \
|
|
||||||
qcma.rc
|
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
src/forms/configwidget.ui \
|
src/forms/configwidget.ui \
|
||||||
src/forms/backupmanagerform.ui \
|
src/forms/backupmanagerform.ui \
|
||||||
@@ -92,26 +77,39 @@ TRANSLATIONS += \
|
|||||||
resources/translations/qcma_es.ts \
|
resources/translations/qcma_es.ts \
|
||||||
resources/translations/qcma_ja.ts
|
resources/translations/qcma_ja.ts
|
||||||
|
|
||||||
VERSION = \\\"'0.2.8'\\\"
|
OTHER_FILES += \
|
||||||
|
resources/xml/psp2-updatelist.xml \
|
||||||
|
resources/images/psv_icon.png \
|
||||||
|
resources/images/psv_icon_16.png \
|
||||||
|
resources/images/qcma.png \
|
||||||
|
resources/qcma.desktop \
|
||||||
|
qcma.rc
|
||||||
|
|
||||||
DEFINES += "QCMA_VER=$${VERSION}"
|
INCLUDEPATH += src/
|
||||||
|
|
||||||
GET_HASHES {
|
RESOURCES += qcmares.qrc translations.qrc
|
||||||
message("Retrieving git hashes")
|
|
||||||
unix {
|
|
||||||
DEFINES += "QCMA_BUILD_HASH=\"\\\"$$system(git rev-parse --short HEAD)\\\"\""
|
|
||||||
DEFINES += "QCMA_BUILD_BRANCH=\"\\\"$$system(git rev-parse --abbrev-ref HEAD)\\\"\""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unix {
|
# find packages using pkg-config
|
||||||
|
CONFIG += link_pkgconfig
|
||||||
|
PKGCONFIG += libvitamtp libavformat libavcodec libavutil libswscale
|
||||||
|
|
||||||
|
# custom CXXFLAGS
|
||||||
|
QMAKE_CXXFLAGS += -Wno-write-strings -Wall -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
|
||||||
|
|
||||||
|
#Linux-only config
|
||||||
|
unix:!macx {
|
||||||
|
# largefile support
|
||||||
|
DEFINES += _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE
|
||||||
|
|
||||||
|
# installation prefix
|
||||||
isEmpty(PREFIX) {
|
isEmpty(PREFIX) {
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
}
|
}
|
||||||
|
|
||||||
BINDIR = $$PREFIX/bin
|
BINDIR = $$PREFIX/bin
|
||||||
DATADIR = $$PREFIX/share
|
DATADIR = $$PREFIX/share
|
||||||
|
|
||||||
|
# config for desktop file and icon
|
||||||
desktop.path = $$DATADIR/applications/$${TARGET}
|
desktop.path = $$DATADIR/applications/$${TARGET}
|
||||||
desktop.files += resources/$${TARGET}.desktop
|
desktop.files += resources/$${TARGET}.desktop
|
||||||
|
|
||||||
@@ -120,22 +118,54 @@ unix {
|
|||||||
|
|
||||||
target.path = $$BINDIR
|
target.path = $$BINDIR
|
||||||
INSTALLS += target desktop icon64
|
INSTALLS += target desktop icon64
|
||||||
}
|
|
||||||
|
|
||||||
unix:!macx:DEFINES += _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE
|
# KDE support
|
||||||
|
ENABLE_KDE {
|
||||||
unix:!macx:ENABLE_KDE {
|
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
error("ENABLE_KDE can only be used with Qt4")
|
||||||
error("ENABLE_KDE can only be used with Qt4")
|
}
|
||||||
}
|
}
|
||||||
LIBS += -lkdeui
|
LIBS += -lkdeui
|
||||||
DEFINES += "ENABLE_KDE_NOTIFIER=1"
|
DEFINES += ENABLE_KDE_NOTIFIER=1
|
||||||
SOURCES += src/kdenotifier.cpp
|
SOURCES += src/kdenotifier.cpp
|
||||||
HEADERS += src/kdenotifier.h
|
HEADERS += src/kdenotifier.h
|
||||||
}
|
}
|
||||||
|
|
||||||
win32:RC_FILE = qcma.rc
|
# Windows config
|
||||||
win32:QMAKE_CXXFLAGS += -mno-ms-bitfields
|
win32 {
|
||||||
|
# Windows icon
|
||||||
|
RC_FILE = qcma.rc
|
||||||
|
# avoid alignment issues with newer mingw compiler
|
||||||
|
QMAKE_CXXFLAGS += -mno-ms-bitfields
|
||||||
|
}
|
||||||
|
|
||||||
ICON = resources/images/$${TARGET}.icns
|
# OS X config
|
||||||
macx:QT_CONFIG -= no-pkg-config
|
macx {
|
||||||
|
# OS X icon
|
||||||
|
ICON = resources/images/$${TARGET}.icns
|
||||||
|
# re-enable pkg-config on OS X (brew installs pkg-config files)
|
||||||
|
QT_CONFIG -= no-pkg-config
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# try to get the current git version + hash
|
||||||
|
QCMA_GIT_VERSION=$$system(git describe --tags)
|
||||||
|
|
||||||
|
#use the generic version if the above command fails (no git executable or metadata)
|
||||||
|
isEmpty(QCMA_GIT_VERSION) {
|
||||||
|
DEFINES += QCMA_VER=\\\"$$VERSION\\\"
|
||||||
|
} else {
|
||||||
|
DEFINES += QCMA_VER=\\\"$$QCMA_GIT_VERSION\\\"
|
||||||
|
}
|
||||||
|
|
||||||
|
GET_HASHES {
|
||||||
|
# try to get the current git commit and branch
|
||||||
|
QCMA_GIT_HASH=$$system(git rev-parse --short HEAD)
|
||||||
|
QCMA_GIT_BRANCH=$$system(git rev-parse --abbrev-ref HEAD)
|
||||||
|
|
||||||
|
# pass the current git commit hash
|
||||||
|
!isEmpty(QCMA_GIT_HASH):!isEmpty(QCMA_GIT_BRANCH) {
|
||||||
|
DEFINES += QCMA_BUILD_HASH=\\\"$$QCMA_GIT_HASH\\\"
|
||||||
|
DEFINES += QCMA_BUILD_BRANCH=\\\"$$QCMA_GIT_BRANCH\\\"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user