Browse Source

cmVersionMacros: Adopt CMake_VERSION_ENCODE

Brad King 1 month ago
parent
commit
c5a1675436

+ 1 - 1
Source/cmExportCMakeConfigGenerator.cxx

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

+ 1 - 1
Source/cmFindPackageCommand.cxx

@@ -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__)

+ 0 - 10
Source/cmVersion.h

@@ -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)))

+ 10 - 0
Source/cmVersionMacros.h

@@ -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)))