summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-12 17:39:35 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-03-12 17:39:45 (GMT)
commit725b0cab863aae5b78bc252f8174b8362954dcab (patch)
tree7c3f5ab31c93c00c453c66bc9db78b5b3a2425e3
parentb340cacde869102b2b548b2e7ebc7341334f1d58 (diff)
parent588a1afe76ad0e5bed5d03403fa7b392cbbcd438 (diff)
downloadCMake-725b0cab863aae5b78bc252f8174b8362954dcab.zip
CMake-725b0cab863aae5b78bc252f8174b8362954dcab.tar.gz
CMake-725b0cab863aae5b78bc252f8174b8362954dcab.tar.bz2
Merge topic 'cmake-rc-version-decimal'
588a1afe76 CMakeVersion.rc: Avoid leading zeros in integer version components Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1835
-rw-r--r--Source/CMakeVersionCompute.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/CMakeVersionCompute.cmake b/Source/CMakeVersionCompute.cmake
index 79264ed..72a5800 100644
--- a/Source/CMakeVersionCompute.cmake
+++ b/Source/CMakeVersionCompute.cmake
@@ -32,7 +32,12 @@ endif()
# components in the RC file are 16-bit integers so we may have to
# split the patch component.
if(CMake_VERSION_PATCH MATCHES "^([0-9]+)([0-9][0-9][0-9][0-9])$")
- set(CMake_RCVERSION ${CMake_VERSION_MAJOR},${CMake_VERSION_MINOR},${CMAKE_MATCH_1},${CMAKE_MATCH_2})
+ set(CMake_RCVERSION_YEAR "${CMAKE_MATCH_1}")
+ set(CMake_RCVERSION_MONTH_DAY "${CMAKE_MATCH_2}")
+ string(REGEX REPLACE "^0+" "" CMake_RCVERSION_MONTH_DAY "${CMake_RCVERSION_MONTH_DAY}")
+ set(CMake_RCVERSION ${CMake_VERSION_MAJOR},${CMake_VERSION_MINOR},${CMake_RCVERSION_YEAR},${CMake_RCVERSION_MONTH_DAY})
+ unset(CMake_RCVERSION_MONTH_DAY)
+ unset(CMake_RCVERSION_YEAR)
else()
set(CMake_RCVERSION ${CMake_VERSION_MAJOR},${CMake_VERSION_MINOR},${CMake_VERSION_PATCH})
endif()