1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include <cm3p/kwiml/int.h>
8 * \brief Helper class for providing CMake and CTest version information.
10 * Finds all version related information.
16 * Return major and minor version numbers for cmake.
18 static unsigned int GetMajorVersion();
19 static unsigned int GetMinorVersion();
20 static unsigned int GetPatchVersion();
21 static unsigned int GetTweakVersion();
22 static const char* GetCMakeVersion();
25 /* Encode with room for up to 1000 minor releases between major releases
26 and to encode dates until the year 10000 in the patch level. */
27 #define CMake_VERSION_ENCODE_BASE KWIML_INT_UINT64_C(100000000)
28 #define CMake_VERSION_ENCODE(major, minor, patch) \
29 ((((major)*1000u) * CMake_VERSION_ENCODE_BASE) + \
30 (((minor) % 1000u) * CMake_VERSION_ENCODE_BASE) + \
31 (((patch) % CMake_VERSION_ENCODE_BASE)))