summaryrefslogtreecommitdiffstats
path: root/Source/CMakeVersionCompute.cmake
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2016-07-01 07:40:09 (GMT)
committerBrad King <brad.king@kitware.com>2016-07-14 14:27:17 (GMT)
commit6a077b5d63895489c2962af2f7302f52444045cc (patch)
treeb5aff09a578383d9fe1fb7240aed31d1cd74ed54 /Source/CMakeVersionCompute.cmake
parent7af4bc69c5a7bbc373f704edddeb7d644c809825 (diff)
downloadCMake-6a077b5d63895489c2962af2f7302f52444045cc.zip
CMake-6a077b5d63895489c2962af2f7302f52444045cc.tar.gz
CMake-6a077b5d63895489c2962af2f7302f52444045cc.tar.bz2
Make CMake version suffix available to code
Make the string (e.g. "rc1" or "gSHA-dirty") available to the code.
Diffstat (limited to 'Source/CMakeVersionCompute.cmake')
-rw-r--r--Source/CMakeVersionCompute.cmake12
1 files changed, 8 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()