summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2013-11-12 09:21:22 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2013-11-12 09:21:22 (GMT)
commit5da6bd762679b25637aec541e8a1cc54f325c9b0 (patch)
treef0a1c5f819c4a4676adb922c6c93440023b4e131
parente90be91360fbbae9a41a5ce16cde0670cfe54c83 (diff)
downloadkolab-utils-5da6bd762679b25637aec541e8a1cc54f325c9b0.tar.gz
Display the version number using --version.
-rw-r--r--CMakeLists.txt2
-rw-r--r--fbdaemon/main.cpp3
-rw-r--r--kolabutils-version.h.cmake24
-rw-r--r--migrationutility/main.cpp3
-rw-r--r--upgradetool/upgradetool.cpp3
5 files changed, 32 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b1ecaf..e258bed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,6 +55,8 @@ endif()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -fexceptions -UQT_NO_EXCEPTIONS -g" )
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DQT_NO_DEBUG")
+configure_file(kolabutils-version.h.cmake "${CMAKE_BINARY_DIR}/kolabutils-version.h" @ONLY)
+
include_directories(./ lib ${QT_INCLUDES} ${KDE_INCLUDES} ${Libkolab_INCLUDES} ${Libkolabxml_INCLUDES})
set(COMMON_DEPENDENCIES
diff --git a/fbdaemon/main.cpp b/fbdaemon/main.cpp
index 75aa6dc..0a9f8dd 100644
--- a/fbdaemon/main.cpp
+++ b/fbdaemon/main.cpp
@@ -23,13 +23,14 @@
#include <kglobal.h>
#include "fbcoordinator.h"
#include "settings.h"
+#include "kolabutils-version.h"
int main(int argc, char *argv[])
{
//Init for ki18n calls
KGlobal::locale();
- KCmdLineArgs::init(argc, argv, argv[0], QByteArray(), ki18n("freebusy"), "0.1", ki18n("kolab freebusy generator"), KCmdLineArgs::CmdLineArgNone);
+ KCmdLineArgs::init(argc, argv, argv[0], QByteArray(), ki18n("freebusy"), KOLABUTILS_VERSION, ki18n("kolab freebusy generator"), KCmdLineArgs::CmdLineArgNone);
KCmdLineOptions options;
options.add("c").add("configuration <file>", ki18n("Configuration file"), "/etc/kolab/kolab.conf");
diff --git a/kolabutils-version.h.cmake b/kolabutils-version.h.cmake
new file mode 100644
index 0000000..ddfd466
--- /dev/null
+++ b/kolabutils-version.h.cmake
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2012 Christian Mollekopf <mollekopf@kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef KOLABUTILS_VERSION_H
+#define KOLABUTILS_VERSION_H
+
+#define KOLABUTILS_VERSION "@Kolabutils_VERSION@"
+#define KOLABUTILS_VERSION_STRING "@Kolabutils_VERSION_STRING@"
+
+#endif \ No newline at end of file
diff --git a/migrationutility/main.cpp b/migrationutility/main.cpp
index 24d9ec2..d501917 100644
--- a/migrationutility/main.cpp
+++ b/migrationutility/main.cpp
@@ -28,6 +28,7 @@
#ifdef BUILD_GOOGLESUPPORT
#include "googlesourceserver.h"
#endif
+#include "kolabutils-version.h"
KIMAP::LoginJob::EncryptionMode getEncryptionMode(const QString &encrypt)
{
@@ -81,7 +82,7 @@ KIMAP::LoginJob::AuthenticationMode getAuthenticationMode(const QString &auth)
*/
int main(int argc, char *argv[])
{
- KCmdLineArgs::init(argc, argv, "migrationutility", "migrationutility",ki18n("migrationutility"), "0.1");
+ KCmdLineArgs::init(argc, argv, "migrationutility", "migrationutility",ki18n("migrationutility"), KOLABUTILS_VERSION);
KCmdLineOptions options;
options.add("dry", ki18n("Dry run, doesn't change anything on the server, but only prints what would be done (Use with care until this is well tested)."));
diff --git a/upgradetool/upgradetool.cpp b/upgradetool/upgradetool.cpp
index 6fc1501..422c449 100644
--- a/upgradetool/upgradetool.cpp
+++ b/upgradetool/upgradetool.cpp
@@ -24,6 +24,7 @@
#include "upgradeutilities.h"
#include "imapupgradejob.h"
+#include "kolabutils-version.h"
/**
* Usage:
@@ -41,7 +42,7 @@
int main(int argc, char *argv[])
{
- KCmdLineArgs::init(argc, argv, "upgradetool", "upgradetool",ki18n("upgradetool"), "0.1");
+ KCmdLineArgs::init(argc, argv, "upgradetool", "upgradetool",ki18n("upgradetool"), KOLABUTILS_VERSION);
KCmdLineOptions options;
options.add("mime", ki18n("Read mime from stdin or file"));