Skip to content

Commit

Permalink
[fingerterm] Pass version as a define. Contributes JB#35198
Browse files Browse the repository at this point in the history
Passes the version string as a define, to avoid having to update a
potentially version-controlled header file.
  • Loading branch information
David Llewellyn-Jones committed Feb 5, 2021
1 parent f21b27a commit 70b35b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 1 addition & 5 deletions rpm/fingerterm.spec
Expand Up @@ -41,14 +41,10 @@ Translation source for %{name}
%prep
%setup -q -n %{name}-%{version}


%build
qmake -qt=5 CONFIG+=enable-feedback CONFIG+=enable-nemonotifications
# Inject version number from RPM into source
sed -i -e 's/PROGRAM_VERSION="[^"]*"/PROGRAM_VERSION="%{version}"/g' version.h
qmake -qt=5 CONFIG+=enable-feedback CONFIG+=enable-nemonotifications DEFINES+='VERSION_STRING=\"\\\"\"%{version}\"\\\"\"'
make %{?_smp_mflags}


%install
rm -rf %{buildroot}
make INSTALL_ROOT=%{buildroot} install
8 changes: 7 additions & 1 deletion version.h
@@ -1,5 +1,11 @@
#ifndef VERSION_H
#define VERSION_H
const QString PROGRAM_VERSION="1.3.12";

#ifndef VERSION_STRING
// It's expected that VERSION_STRING will be defined by the build engine
#define VERSION_STRING "0.0.0"
#endif

const QString PROGRAM_VERSION=QLatin1String(VERSION_STRING);
#endif

0 comments on commit 70b35b1

Please sign in to comment.