diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2021-05-27 18:14:49 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2021-05-27 19:18:37 (GMT) |
commit | e609afeb5f4385755a6d0f2fdb45fcdfb0a01b7a (patch) | |
tree | 375cfa4058b154ec4f5673310e460aa728e1175f /Modules/BasicConfigVersion-SameMajorVersion.cmake.in | |
parent | c5657a2fe42a0de7a5724507888f9f6f1afff8ea (diff) | |
download | CMake-e609afeb5f4385755a6d0f2fdb45fcdfb0a01b7a.zip CMake-e609afeb5f4385755a6d0f2fdb45fcdfb0a01b7a.tar.gz CMake-e609afeb5f4385755a6d0f2fdb45fcdfb0a01b7a.tar.bz2 |
WriteBasicConfigVersion supports version strings such as 21.07.04
Fixes #22207
Diffstat (limited to 'Modules/BasicConfigVersion-SameMajorVersion.cmake.in')
-rw-r--r-- | Modules/BasicConfigVersion-SameMajorVersion.cmake.in | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in index dc04e54..cf73f60 100644 --- a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in +++ b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in @@ -17,6 +17,9 @@ else() if("@CVF_VERSION@" MATCHES "^([0-9]+)\\.") set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) + string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") + endif() else() set(CVF_VERSION_MAJOR "@CVF_VERSION@") endif() |