Warning, /libraries/libtmdbqt/src/version.h.cmake is written in an unsupported language. File is not indexed.
0001 /*
0002 * Copyright (C) 2014 David Faure <faure@kde.org>
0003 *
0004 * This library is free software; you can redistribute it and/or
0005 * modify it under the terms of the GNU Library General Public
0006 * License as published by the Free Software Foundation; either
0007 * version 2 of the License, or (at your option) any later version.
0008 *
0009 * This library is distributed in the hope that it will be useful,
0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0012 * Library General Public License for more details.
0013 *
0014 * You should have received a copy of the GNU Library General Public License
0015 * along with this library; see the file COPYING.LIB. If not, write to
0016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017 * Boston, MA 02110-1301, USA.
0018 */
0019
0020 #ifndef _TMDBQT_VERSION_H_
0021 #define _TMDBQT_VERSION_H_
0022
0023 #include "tmdbqt_export.h"
0024
0025 /// @brief TmdbQt version as string at compile time.
0026 #define LIBTMDBQT_VERSION_STRING "${CMAKE_LIBTMDBQT_VERSION_STRING}"
0027
0028 /// @brief The major TmdbQt version number at compile time
0029 #define LIBTMDBQT_VERSION_MAJOR ${CMAKE_LIBTMDBQT_VERSION_MAJOR}
0030
0031 /// @brief The minor TmdbQt version number at compile time
0032 #define LIBTMDBQT_VERSION_MINOR ${CMAKE_LIBTMDBQT_VERSION_MINOR}
0033
0034 /// @brief The TmdbQt release version number at compile time
0035 #define LIBTMDBQT_VERSION_RELEASE ${CMAKE_LIBTMDBQT_VERSION_PATCH}
0036
0037 /**
0038 * \brief Create a unique number from the major, minor and release number of a %TmdbQt version
0039 *
0040 * This function can be used for preprocessing. For version information at runtime
0041 * use the version methods in the TmdbQt namespace.
0042 */
0043 #define LIBTMDBQT_MAKE_VERSION( a,b,c ) (((a) << 16) | ((b) << 8) | (c))
0044
0045 /**
0046 * \brief %TmdbQt Version as a unique number at compile time
0047 *
0048 * This macro calculates the %TmdbQt version into a number. It is mainly used
0049 * through LIBTMDBQT_IS_VERSION in preprocessing. For version information at runtime
0050 * use the version methods in the TmdbQt namespace.
0051 */
0052 #define LIBTMDBQT_VERSION \
0053 LIBTMDBQT_MAKE_VERSION(LIBTMDBQT_VERSION_MAJOR,LIBTMDBQT_VERSION_MINOR,LIBTMDBQT_VERSION_RELEASE)
0054
0055 /**
0056 * \brief Check if the %TmdbQt version matches a certain version or is higher
0057 *
0058 * This macro is typically used to compile conditionally a part of code:
0059 * \code
0060 * #if LIBTMDBQT_IS_VERSION(2,1)
0061 * // Code for TmdbQt 2.1
0062 * #else
0063 * // Code for TmdbQt 2.0
0064 * #endif
0065 * \endcode
0066 *
0067 * For version information at runtime
0068 * use the version methods in the TmdbQt namespace.
0069 */
0070 #define LIBTMDBQT_IS_VERSION(a,b,c) ( LIBTMDBQT_VERSION >= LIBTMDBQT_MAKE_VERSION(a,b,c) )
0071
0072
0073 namespace TmdbQt {
0074 /**
0075 * @brief Returns the major number of TmdbQt's version, e.g.
0076 * 1 for %TmdbQt 1.0.2.
0077 * @return the major version number at runtime.
0078 */
0079 TMDBQT_EXPORT unsigned int versionMajor();
0080
0081 /**
0082 * @brief Returns the minor number of TmdbQt's version, e.g.
0083 * 0 for %TmdbQt 1.0.2.
0084 * @return the minor version number at runtime.
0085 */
0086 TMDBQT_EXPORT unsigned int versionMinor();
0087
0088 /**
0089 * @brief Returns the release of TmdbQt's version, e.g.
0090 * 2 for %TmdbQt 1.0.2.
0091 * @return the release number at runtime.
0092 */
0093 TMDBQT_EXPORT unsigned int versionRelease();
0094
0095 /**
0096 * @brief Returns the %TmdbQt version as string, e.g. "1.0.2".
0097 *
0098 * On contrary to the macro LIBTMDBQT_VERSION_STRING this function returns
0099 * the version number of TmdbQt at runtime.
0100 * @return the %TmdbQt version. You can keep the string forever
0101 */
0102 TMDBQT_EXPORT const char* versionString();
0103 }
0104
0105 #endif