summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRagnar Thomsen <[email protected]>2015-07-30 20:16:57 +0200
committerRagnar Thomsen <[email protected]>2015-07-30 20:16:57 +0200
commita992a8cdbe41db2c8869c79d42ff9cd09dfaf66b (patch)
tree34cb30dd122aca4a6c16b80ab36849d8736289e7
parentde64aa708e91e013ba8d0fa504aa82f8bef6cc96 (diff)
Enable automatic update of version number
Use CMake variables autoupdated by release script. Gwenview version is automatically updated to KDE Applications version.
-rw-r--r--CMakeLists.txt11
-rw-r--r--lib/about.cpp4
-rw-r--r--lib/version.h38
3 files changed, 13 insertions, 40 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee82459..a3753a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,11 @@
project(gwenview)
+# KDE Application Version, managed by release script
+set (KDE_APPLICATIONS_VERSION_MAJOR "15")
+set (KDE_APPLICATIONS_VERSION_MINOR "07")
+set (KDE_APPLICATIONS_VERSION_MICRO "80")
+set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
+
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
@@ -20,6 +26,11 @@ include(ECMAddAppIcon)
include(GenerateExportHeader)
include(FeatureSummary)
+## Generate header with version number
+ecm_setup_version(${KDE_APPLICATIONS_VERSION}
+ VARIABLE_PREFIX GWENVIEW
+ VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/lib/gwenview_version.h"
+)
## CMake options
set(GWENVIEW_SEMANTICINFO_BACKEND_NONE OFF)
diff --git a/lib/about.cpp b/lib/about.cpp
index ca2c912..46360a0 100644
--- a/lib/about.cpp
+++ b/lib/about.cpp
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "about.h"
// Local
-#include <version.h>
+#include "gwenview_version.h"
// KDE
#include <KAboutData>
@@ -34,7 +34,7 @@ namespace Gwenview
KAboutData* createAboutData(const QString& appName, const QString& programName)
{
- KAboutData* data = new KAboutData(appName, programName, GWENVIEW_VERSION);
+ KAboutData* data = new KAboutData(appName, programName, QStringLiteral(GWENVIEW_VERSION_STRING));
data->setLicense(KAboutLicense::GPL);
data->setCopyrightStatement(i18n("Copyright 2000-2014 Gwenview authors"));
data->addAuthor(
diff --git a/lib/version.h b/lib/version.h
deleted file mode 100644
index 584c2ce..0000000
--- a/lib/version.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// vim: set tabstop=4 shiftwidth=4 expandtab:
-/*
-Gwenview: an image viewer
-Copyright 2010-2013 Aurélien Gâteau <[email protected]>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
-
-*/
-#ifndef VERSION_H
-#define VERSION_H
-
-/*
-
-For stable releases, GWENVIEW_VERSION should be "$major.$minor.$patch",
-matching KDE SC versions.
-
-For unstable releases, it should be "$major.$minor.$patch $suffix", where
-suffix is one of "pre", "alpha$N", "beta$N" or "rc$N".
-
-When you change GWENVIEW_VERSION, add the new version in Bugzilla as well:
-https://bugs.kde.org/editversions.cgi?product=gwenview
-
-*/
-#define GWENVIEW_VERSION "5.0.0"
-
-#endif /* VERSION_H */