summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/CMakeVersionCompute.cmake12
-rw-r--r--Source/cmVersionConfig.h.in1
2 files changed, 9 insertions, 4 deletions
diff --git a/Source/CMakeVersionCompute.cmake b/Source/CMakeVersionCompute.cmake
index 496d6cf..806e987 100644
--- a/Source/CMakeVersionCompute.cmake
+++ b/Source/CMakeVersionCompute.cmake
@@ -12,9 +12,13 @@ endif()
# Compute the full version string.
set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
-if(CMake_VERSION_RC)
- set(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
-endif()
if(CMake_VERSION_SOURCE)
- set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
+ set(CMake_VERSION_SUFFIX "${CMake_VERSION_SOURCE}")
+elseif(CMake_VERSION_RC)
+ set(CMake_VERSION_SUFFIX "rc${CMake_VERSION_RC}")
+else()
+ set(CMake_VERSION_SUFFIX "")
+endif()
+if(CMake_VERSION_SUFFIX)
+ set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SUFFIX})
endif()
diff --git a/Source/cmVersionConfig.h.in b/Source/cmVersionConfig.h.in
index 16aeabe..af5c57b 100644
--- a/Source/cmVersionConfig.h.in
+++ b/Source/cmVersionConfig.h.in
@@ -12,4 +12,5 @@
#define CMake_VERSION_MAJOR @CMake_VERSION_MAJOR@
#define CMake_VERSION_MINOR @CMake_VERSION_MINOR@
#define CMake_VERSION_PATCH @CMake_VERSION_PATCH@
+#define CMake_VERSION_SUFFIX "@CMake_VERSION_SUFFIX@"
#define CMake_VERSION "@CMake_VERSION@"