cmVersion.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmVersion_h
  4. #define cmVersion_h
  5. #include "cm_kwiml.h"
  6. /** \class cmVersion
  7. * \brief Helper class for providing CMake and CTest version information.
  8. *
  9. * Finds all version related information.
  10. */
  11. class cmVersion
  12. {
  13. public:
  14. /**
  15. * Return major and minor version numbers for cmake.
  16. */
  17. static unsigned int GetMajorVersion();
  18. static unsigned int GetMinorVersion();
  19. static unsigned int GetPatchVersion();
  20. static unsigned int GetTweakVersion();
  21. static const char* GetCMakeVersion();
  22. };
  23. /* Encode with room for up to 1000 minor releases between major releases
  24. and to encode dates until the year 10000 in the patch level. */
  25. #define CMake_VERSION_ENCODE__BASE KWIML_INT_UINT64_C(100000000)
  26. #define CMake_VERSION_ENCODE(major, minor, patch) \
  27. ((((major)*1000u) * CMake_VERSION_ENCODE__BASE) + \
  28. (((minor) % 1000u) * CMake_VERSION_ENCODE__BASE) + \
  29. (((patch) % CMake_VERSION_ENCODE__BASE)))
  30. #endif