cmVersion.h 1.13 KB
Newer Older
1 2
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
3 4 5
#ifndef cmVersion_h
#define cmVersion_h

6
#include "cm_kwiml.h"
7 8 9 10 11 12 13 14 15 16 17 18

/** \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.
   */
19 20 21
  static unsigned int GetMajorVersion();
  static unsigned int GetMinorVersion();
  static unsigned int GetPatchVersion();
22
  static unsigned int GetTweakVersion();
23
  static const char* GetCMakeVersion();
24 25
};

26 27
/* Encode with room for up to 1000 minor releases between major releases
   and to encode dates until the year 10000 in the patch level.  */
28
#define CMake_VERSION_ENCODE__BASE KWIML_INT_UINT64_C(100000000)
29 30 31 32
#define CMake_VERSION_ENCODE(major, minor, patch)                             \
  ((((major)*1000u) * CMake_VERSION_ENCODE__BASE) +                           \
   (((minor) % 1000u) * CMake_VERSION_ENCODE__BASE) +                         \
   (((patch) % CMake_VERSION_ENCODE__BASE)))
33

34
#endif