Warning, /office/kexi/src/KexiVersion.h.cmake is written in an unsupported language. File is not indexed.

0001 /* This file is part of the KDE project
0002    Copyright (c) 2003-2016 KEXI Team <kexi@kde.org>
0003 
0004    Version information based on calligraversion.h,
0005    Copyright (c) 2003 David Faure <faure@kde.org>
0006    Copyright (c) 2003 Lukas Tinkl <lukas@kde.org>
0007    Copyright (c) 2004 Nicolas Goutte <goutte@kde.org>
0008 
0009    This library is free software; you can redistribute it and/or
0010    modify it under the terms of the GNU Library General Public
0011    License as published by the Free Software Foundation; either
0012    version 2 of the License, or (at your option) any later version.
0013 
0014    This library is distributed in the hope that it will be useful,
0015    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017    Library General Public License for more details.
0018 
0019    You should have received a copy of the GNU Library General Public License
0020    along with this library; see the file COPYING.LIB.  If not, write to
0021    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0022  * Boston, MA 02110-1301, USA.
0023 */
0024 
0025 #ifndef KEXIVERSION_H
0026 #define KEXIVERSION_H
0027 
0028 #include <core/kexicore_export.h>
0029 
0030 // -- WARNING: do not edit values below, instead edit constants in SetKexiVersionInfo.cmake
0031 
0032 class QString;
0033 
0034 /**
0035 * @def KEXI_VERSION_STRING
0036 * @ingroup KexiMacros
0037 * @brief Version of KEXI as string, at compile time
0038 *
0039 * This macro contains the KEXI version in string form. As it is a macro,
0040 * it contains the version at compile time. See Kexi::versionString() if you need
0041 * a version used at runtime.
0042 *
0043 * @note The version string might contain spaces and special characters,
0044 * especially for development versions of KEXI.
0045 * If you use that macro directly for a file format (e.g. OASIS Open Document)
0046 * or for a protocol (e.g. http) be careful that it is appropriate.
0047 * (Fictional) example: "3.0 Alpha"
0048 */
0049 #define KEXI_VERSION_STRING "@PROJECT_VERSION_STRING@"
0050 
0051 /**
0052 * @def KEXI_VERSION_MAJOR_MINOR_RELEASE
0053 * @ingroup KexiMacros
0054 * @brief Version string containing "major.minor.release"
0055 * @brief Version of KEXI as string, at compile time
0056 *
0057 * This macro contains the KEXI version in string form. As it is a macro,
0058 * it contains the version at compile time.
0059 *
0060 * @note The version string never contains spaces or special characters.
0061 */
0062 #define KEXI_VERSION_MAJOR_MINOR_RELEASE "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_RELEASE@"
0063 
0064 /**
0065  * @def KEXI_STABLE_VERSION_MAJOR
0066  * @ingroup KexiMacros
0067  * @brief Major version of stable KEXI, at compile time
0068  * KEXI_VERSION_MAJOR is computed based on this value.
0069 */
0070 #define KEXI_STABLE_VERSION_MAJOR @PROJECT_STABLE_VERSION_MAJOR@
0071 
0072 /**
0073  * @def KEXI_VERSION_MAJOR
0074  * @ingroup KexiMacros
0075  * @brief Major version of KEXI, at compile time
0076  *
0077  * Generally it's the same as KEXI_STABLE_VERSION_MAJOR but for unstable x.0
0078  * x is decreased by one, e.g. 3.0 Beta 1 is 2.91.
0079 */
0080 #define KEXI_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
0081 
0082 /**
0083  * @def KEXI_STABLE_VERSION_MINOR
0084  * @ingroup KexiMacros
0085  * @brief Minor version of stable KEXI, at compile time
0086  * KEXI_VERSION_MINOR is computed based on this value.
0087  */
0088 #define KEXI_STABLE_VERSION_MINOR @PROJECT_STABLE_VERSION_MINOR@
0089 
0090 /**
0091  * @def KEXI_VERSION_MINOR
0092  * @ingroup KexiMacros
0093  * @brief Minor version of KEXI, at compile time
0094  *
0095  * Generally it's equal to KEXI_STABLE_VERSION_MINOR for stable releases,
0096  * equal to 9x for x.0 unstable releases (e.g. 3.0 Beta 1 has minor version 91).
0097  */
0098 #define KEXI_VERSION_MINOR @PROJECT_VERSION_MINOR@
0099 
0100 /**
0101  * @def KEXI_VERSION_RELEASE
0102  * @ingroup KexiMacros
0103  * @brief Release version of Kexi, at compile time.
0104  * 90 for Alpha.
0105  */
0106 #define KEXI_VERSION_RELEASE @PROJECT_VERSION_RELEASE@
0107 
0108 /**
0109  * @def KEXI_STABLE_VERSION_RELEASE
0110  * @ingroup KexiMacros
0111  * @brief Release version of KEXI, at compile time.
0112  *
0113  * Equal to KEXI_VERSION_RELEASE for stable releases and 0 for unstable ones.
0114  */
0115 #define KEXI_STABLE_VERSION_RELEASE @PROJECT_STABLE_VERSION_RELEASE@
0116 
0117 /**
0118  * @def KEXI_ALPHA
0119  * @ingroup KexiMacros
0120  * @brief If defined (1), indicates at compile time that Kexi is in alpha stage
0121  */
0122 #cmakedefine KEXI_ALPHA @KEXI_ALPHA@
0123 
0124 /**
0125  * @def KEXI_BETA
0126  * @ingroup KexiMacros
0127  * @brief If defined (1, 2..), indicates at compile time that Kexi is in beta stage
0128  */
0129 #cmakedefine KEXI_BETA @KEXI_BETA@
0130 
0131 /**
0132  * @def KEXI_RC
0133  * @ingroup KexiMacros
0134  * @brief If defined (1, 2..), indicates at compile time that Kexi is in "release candidate" stage
0135  */
0136 #cmakedefine KEXI_RC @KEXI_RC@
0137 
0138 /**
0139  * @def KEXI_STABLE
0140  * @ingroup KexiMacros
0141  * @brief If defined, indicates at compile time that KEXI is in stable stage
0142  */
0143 #cmakedefine KEXI_STABLE @KEXI_STABLE@
0144 
0145 /**
0146  * @def KEXI_STAGE
0147  * @ingroup KexiMacros
0148  * @brief Release stage (number) for Kexi, e.g. 1 for Beta 1, 2 for 3.3.2, etc.
0149  */
0150 #define KEXI_STAGE @KEXI_STAGE@
0151 
0152 /**
0153  * @ingroup KexiMacros
0154  * @brief Make a number from the major, minor and release number of a KEXI version
0155  *
0156  * This function can be used for preprocessing when KEXI_IS_VERSION is not
0157  * appropriate.
0158  */
0159 #define KEXI_MAKE_VERSION( a,b,c ) (((a) << 16) | ((b) << 8) | (c))
0160 
0161 /**
0162  * @ingroup KexiMacros
0163  * @brief Version of KEXI as number, at compile time
0164  *
0165  * This macro contains the KEXI version in number form. As it is a macro,
0166  * it contains the version at compile time. See version() if you need
0167  * the KEXI version used at runtime.
0168  */
0169 #define KEXI_VERSION \
0170     KEXI_MAKE_VERSION(KEXI_VERSION_MAJOR,KEXI_VERSION_MINOR,KEXI_VERSION_RELEASE)
0171 
0172 /**
0173  * @ingroup KexiMacros
0174  * @brief Check if the KEXI version matches a certain version or is higher
0175  *
0176  * This macro is typically used to compile conditionally a part of code:
0177  * @code
0178  * #if KEXI_IS_VERSION(2,3,0)
0179  * // Code for KEXI 2.3.0
0180  * #else
0181  * // Code for older KEXI
0182  * #endif
0183  * @endcode
0184  *
0185  * @warning Especially during development phases of KEXI, be careful
0186  * when choosing the version number that you are checking against.
0187  * Otherwise you might risk to break the next KEXI release.
0188  * Therefore be careful that development version have a
0189  * version number lower than the released version, so do not check
0190  * e.g. for KEXI 4.3 with KEXI_IS_VERSION(4,3,0)
0191  * but with the actual version number at a time a needed feature was introduced, e.g. 4.3.2.
0192  */
0193 #define KEXI_IS_VERSION(a,b,c) ( KEXI_VERSION >= KEXI_MAKE_VERSION(a,b,c) )
0194 
0195 /**
0196  * @def KEXI_YEAR
0197  * @ingroup KexiMacros
0198  * @brief Year of the KEXI release, set at compile time
0199  *
0200  * This macro is used in "About application" dialog for strings such as "© 2012-..., The Author Team".
0201 */
0202 #cmakedefine KEXI_YEAR "@KEXI_YEAR@"
0203 
0204 /**
0205  * @def KEXI_GIT_SHA1_STRING
0206  * @ingroup KexiMacros
0207  * @brief Indicates the git sha1 commit which was used for compilation of KEXI
0208  */
0209 #cmakedefine KEXI_GIT_SHA1_STRING "@KEXI_GIT_SHA1_STRING@"
0210 
0211 /**
0212  * @def KEXI_GIT_BRANCH_STRING
0213  * @ingroup KexiMacros
0214  * @brief Indicates the git branch name which was used for compilation of KEXI
0215  */
0216 #cmakedefine KEXI_GIT_BRANCH_STRING "@KEXI_GIT_BRANCH_STRING@"
0217 
0218 /**
0219  * @def KEXI_DISTRIBUTION_VERSION
0220  * @ingroup KexiMacros
0221  * @brief Name of KEXI version useful to construct co-installabile releases
0222  * By default is it equal to KEXI_STABLE_VERSION_MAJOR.KEXI_STABLE_VERSION_MINOR.
0223  * It can be changed at configure stage by setting the KEXI_CUSTOM_DISTRIBUTION_VERSION
0224  * CMake variable.
0225  * @see KEXI_BASE_PATH
0226  */
0227 #cmakedefine KEXI_DISTRIBUTION_VERSION "@KEXI_DISTRIBUTION_VERSION@"
0228 
0229 /**
0230  * @def KEXI_BASE_PATH
0231  * @ingroup KexiMacros
0232  * @brief Relative path name useful to construct co-installabile file names and paths
0233  * It is equal to "kexi/N" where N is KEXI_DISTRIBUTION_VERSION.
0234  */
0235 #cmakedefine KEXI_BASE_PATH "@KEXI_BASE_PATH@"
0236 
0237 /**
0238  * Namespace for general KEXI functions.
0239  */
0240 namespace Kexi
0241 {
0242 /**
0243  * Returns the encoded number of KEXI version, see the KEXI_VERSION macro.
0244  * In contrary to that macro this function returns the number of the actually
0245  * installed KEXI version, not the number of the KEXI version that was
0246  * installed when the program was compiled.
0247  * @return the version number, encoded in a single int
0248  */
0249 KEXICORE_EXPORT unsigned int version();
0250 /**
0251  * Returns the major number of KEXI version, e.g.
0252  * 1 for KEXI 1.2.3.
0253  * @return the major version number
0254  */
0255 KEXICORE_EXPORT unsigned int versionMajor();
0256 /**
0257  * Returns the minor number of KEXI version, e.g.
0258  * 2 for KEXI 1.2.3.
0259  * @return the minor version number
0260  */
0261 KEXICORE_EXPORT unsigned int versionMinor();
0262 /**
0263  * Returns the release of KEXI version, e.g.
0264  * 3 for KEXI 1.2.3.
0265  * @return the release number
0266  */
0267 KEXICORE_EXPORT unsigned int versionRelease();
0268 /**
0269  * Returns the KEXI version as string, e.g. "1.2.3"
0270  * Sometimes it may be even something like "1.2.3 beta 2"
0271  * @return the KEXI version. You can keep the string forever
0272  */
0273 KEXICORE_EXPORT const char *versionString();
0274 /**
0275  * @return the KEXI version string (versionString()) but appends extra information
0276  * such as "(git 4e06281 master)" if available.
0277  */
0278 KEXICORE_EXPORT const char *fullVersionString();
0279 /**
0280  * Returns the encoded number of stable KEXI version.
0281  * For 2.3.1 it returns 2.3.1, for 2.5.70 returns 2.6.0, for 2.9.70 returns 3.0.0.
0282  * In contrary to KEXI_STABLE_VERSION macro this function returns the number
0283  * of the actually installed KEXI version, not the number of the KEXI version that was
0284  * installed when the program was compiled.
0285  * @return the version number, encoded in a single int
0286  * @see Kexi::version()
0287  * @see KEXI_STABLE_VERSION
0288  */
0289 KEXICORE_EXPORT unsigned int stableVersion();
0290 /**
0291  * Returns the major number of stable KEXI version, e.g.
0292  * 1 for KEXI 1.2.3.
0293  * @return the major stable version number
0294  */
0295 KEXICORE_EXPORT unsigned int stableVersionMajor();
0296 /**
0297  * Returns the minor number of stable KEXI version, e.g.
0298  * 2 for KEXI 1.2.3.
0299  * @return the minor stable version number
0300  */
0301 KEXICORE_EXPORT unsigned int stableVersionMinor();
0302 /**
0303  * Returns the release of stable KEXI version, e.g.
0304  * 3 for KEXI 1.2.3.
0305  * @return the release stable version number
0306  */
0307 KEXICORE_EXPORT unsigned int stableVersionRelease();
0308 /**
0309  * Returns the stable KEXI version as string, e.g. "1.2.3"
0310  * It never contains alpha, beta or rc part.
0311  * @return the stable KEXI version.
0312  */
0313 KEXICORE_EXPORT QString stableVersionString();
0314 }
0315 
0316 #endif