aboutsummaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorNiels Ole Salscheider <niels_ole@salscheider-online.de>2017-09-04 12:58:48 +0200
committerNiels Ole Salscheider <niels_ole@salscheider-online.de>2017-09-04 19:44:01 +0200
commitad7910dabd6cdbbb62fe4c8718f69e6c291a78cc (patch)
treeab8befd3ab34c1c664cc683aeb9d2c5fd852ed06 /src/base
parent2a5ccd3bd191b75b9fa148a8fa7f3d3ddc225add (diff)
downloadqxmpp-ad7910dabd6cdbbb62fe4c8718f69e6c291a78cc.tar.gz
Generate QXmppGlobal from the build system
Diffstat (limited to 'src/base')
-rw-r--r--src/base/QXmppGlobal.cpp34
-rw-r--r--src/base/QXmppGlobal.h.in (renamed from src/base/QXmppGlobal.h)25
2 files changed, 11 insertions, 48 deletions
diff --git a/src/base/QXmppGlobal.cpp b/src/base/QXmppGlobal.cpp
deleted file mode 100644
index a0d9ce89..00000000
--- a/src/base/QXmppGlobal.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2008-2014 The QXmpp developers
- *
- * Author:
- * Manjeet Dahiya
- *
- * Source:
- * https://github.com/qxmpp-project/qxmpp
- *
- * This file is a part of QXmpp library.
- *
- * This library 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 2.1 of the License, or (at your option) any later version.
- *
- * This library 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.
- *
- */
-
-
-#include "QXmppGlobal.h"
-
-QString QXmppVersion()
-{
- return QString("%1.%2.%3").arg(
- QString::number((QXMPP_VERSION >> 16) & 0xff),
- QString::number((QXMPP_VERSION >> 8) & 0xff),
- QString::number(QXMPP_VERSION & 0xff));
-}
-
diff --git a/src/base/QXmppGlobal.h b/src/base/QXmppGlobal.h.in
index 8024ce73..80ba8375 100644
--- a/src/base/QXmppGlobal.h
+++ b/src/base/QXmppGlobal.h.in
@@ -1,8 +1,9 @@
/*
- * Copyright (C) 2008-2014 The QXmpp developers
+ * Copyright (C) 2008-2017 The QXmpp developers
*
* Author:
* Manjeet Dahiya
+ * Niels Ole Salscheider
*
* Source:
* https://github.com/qxmpp-project/qxmpp
@@ -27,21 +28,13 @@
#include <QString>
-#if defined(QXMPP_STATIC)
-# define QXMPP_EXPORT
-#else
-# if defined(QXMPP_BUILD)
+#if defined(QXMPP_BUILD)
# define QXMPP_EXPORT Q_DECL_EXPORT
-# else
+#else
# define QXMPP_EXPORT Q_DECL_IMPORT
-# endif
#endif
-#if defined(QXMPP_AUTOTEST_INTERNAL)
-# define QXMPP_AUTOTEST_EXPORT QXMPP_EXPORT
-#else
-# define QXMPP_AUTOTEST_EXPORT
-#endif
+#define QXMPP_AUTOTEST_EXPORT
/// This macro expands a numeric value of the form 0xMMNNPP (MM =
/// major, NN = minor, PP = patch) that specifies QXmpp's version
@@ -52,8 +45,12 @@
/// available.
///
-#define QXMPP_VERSION 0x000903
+#define QXMPP_VERSION (0x@VERSION_MAJOR@ << 16) | (0x@VERSION_MINOR@ << 8) | 0x@VERSION_PATCH@
-QXMPP_EXPORT QString QXmppVersion();
+inline QLatin1String QXmppVersion()
+{
+ return QLatin1String("@VERSION_STRING@");
+}
#endif //QXMPPGLOBAL_H
+