1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

cmVersionMacros: Adopt CMake_VERSION_ENCODE

This commit is contained in:
Brad King
2025-09-24 17:36:05 -04:00
parent cc2642c933
commit c5a1675436
4 changed files with 12 additions and 12 deletions

View File

@@ -26,7 +26,7 @@
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmValue.h"
#include "cmVersion.h"
#include "cmVersionMacros.h"
struct cmLinkInterface;

View File

@@ -43,7 +43,7 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
#include "cmVersion.h"
#include "cmVersionMacros.h"
#include "cmWindowsRegistry.h"
#if defined(__HAIKU__)

View File

@@ -2,8 +2,6 @@
file LICENSE.rst or https://cmake.org/licensing for details. */
#pragma once
#include <cm3p/kwiml/int.h>
/** \class cmVersion
* \brief Helper class for providing CMake and CTest version information.
*
@@ -21,11 +19,3 @@ public:
static unsigned int GetTweakVersion();
static char const* GetCMakeVersion();
};
/* Encode with room for up to 1000 minor releases between major releases
and to encode dates until the year 10000 in the patch level. */
#define CMake_VERSION_ENCODE_BASE KWIML_INT_UINT64_C(100000000)
#define CMake_VERSION_ENCODE(major, minor, patch) \
((((major) * 1000u) * CMake_VERSION_ENCODE_BASE) + \
(((minor) % 1000u) * CMake_VERSION_ENCODE_BASE) + \
(((patch) % CMake_VERSION_ENCODE_BASE)))

View File

@@ -2,9 +2,19 @@
file LICENSE.rst or https://cmake.org/licensing for details. */
#pragma once
#include <cm3p/kwiml/int.h>
#include "cmVersionConfig.h"
#define CMake_VERSION_PATCH_IS_RELEASE(patch) ((patch) < 20000000)
#if CMake_VERSION_PATCH_IS_RELEASE(CMake_VERSION_PATCH)
# define CMake_VERSION_IS_RELEASE 1
#endif
/* Encode with room for up to 1000 minor releases between major releases
and to encode dates until the year 10000 in the patch level. */
#define CMake_VERSION_ENCODE_BASE KWIML_INT_UINT64_C(100000000)
#define CMake_VERSION_ENCODE(major, minor, patch) \
((((major) * 1000u) * CMake_VERSION_ENCODE_BASE) + \
(((minor) % 1000u) * CMake_VERSION_ENCODE_BASE) + \
(((patch) % CMake_VERSION_ENCODE_BASE)))