mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 18:40:13 -06:00
improve the way the git hash is included in the binary
should be better for use of ccache and so on
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "AboutDialog.h"
|
||||
#include "ui_AboutDialog.h"
|
||||
#include "gen_version.h"
|
||||
#include <sqlite3.h>
|
||||
|
||||
AboutDialog::AboutDialog(QWidget *parent) :
|
||||
|
||||
18
src/src.pro
18
src/src.pro
@@ -17,6 +17,18 @@ CONFIG(unittest) {
|
||||
SOURCES += main.cpp
|
||||
}
|
||||
|
||||
# version reporting
|
||||
#version.depends = version.sh
|
||||
# the following line is commented because otherwise qmake would always call
|
||||
# this build step and would always relink the target
|
||||
# I assume that is kinda ok for release, but for development we dont care
|
||||
# about an all time super actual git version number
|
||||
# so this is disabled for the debug build
|
||||
#CONFIG(debug,debug|release):version.target = Makefile.Debug
|
||||
CONFIG(release,debug|release):version.target = Makefile.Release
|
||||
version.commands = sh $$PWD/version.sh $$PWD
|
||||
QMAKE_EXTRA_TARGETS += version
|
||||
|
||||
HEADERS += \
|
||||
sqlitedb.h \
|
||||
MainWindow.h \
|
||||
@@ -35,7 +47,8 @@ HEADERS += \
|
||||
grammar/Sqlite3Parser.hpp \
|
||||
grammar/sqlite3TokenTypes.hpp \
|
||||
sqlitetablemodel.h \
|
||||
FilterTableHeader.h
|
||||
FilterTableHeader.h \
|
||||
gen_version.h
|
||||
|
||||
SOURCES += \
|
||||
sqlitedb.cpp \
|
||||
@@ -68,9 +81,6 @@ FORMS += \
|
||||
ExportCsvDialog.ui \
|
||||
ImportCsvDialog.ui
|
||||
|
||||
|
||||
QMAKE_CXXFLAGS += -DAPP_VERSION=\\\"`cd $$PWD;git log -n1 --format=%h_git`\\\"
|
||||
|
||||
unix {
|
||||
LIBS += -ldl
|
||||
}
|
||||
|
||||
4
src/version.sh
Executable file
4
src/version.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
cd $1
|
||||
echo -n "#define APP_VERSION " > gen_version.h
|
||||
git log -n1 --format="\"%h_git\"" >> gen_version.h
|
||||
Reference in New Issue
Block a user