cmake/Source/cmVersion.h

32 lines
1.1 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2020-08-30 11:54:41 +02:00
#include <cm3p/kwiml/int.h>
/** \class cmVersion
* \brief Helper class for providing CMake and CTest version information.
*
* Finds all version related information.
*/
class cmVersion
{
public:
/**
* Return major and minor version numbers for cmake.
*/
2009-10-04 10:30:41 +03:00
static unsigned int GetMajorVersion();
static unsigned int GetMinorVersion();
static unsigned int GetPatchVersion();
2010-06-23 01:18:35 +03:00
static unsigned int GetTweakVersion();
2009-10-04 10:30:41 +03:00
static const char* GetCMakeVersion();
};
2014-08-03 19:52:23 +02:00
/* Encode with room for up to 1000 minor releases between major releases
and to encode dates until the year 10000 in the patch level. */
2021-09-14 00:13:48 +02:00
#define CMake_VERSION_ENCODE_BASE KWIML_INT_UINT64_C(100000000)
2016-07-09 11:21:54 +02:00
#define CMake_VERSION_ENCODE(major, minor, patch) \
2021-09-14 00:13:48 +02:00
((((major)*1000u) * CMake_VERSION_ENCODE_BASE) + \
(((minor) % 1000u) * CMake_VERSION_ENCODE_BASE) + \
(((patch) % CMake_VERSION_ENCODE_BASE)))