diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-07-01 07:40:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-07-14 14:27:17 (GMT) |
commit | 6a077b5d63895489c2962af2f7302f52444045cc (patch) | |
tree | b5aff09a578383d9fe1fb7240aed31d1cd74ed54 /Source/CMakeVersionCompute.cmake | |
parent | 7af4bc69c5a7bbc373f704edddeb7d644c809825 (diff) | |
download | CMake-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.cmake | 12 |
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() |