WriteBasicConfigVersion supports version strings such as 21.07.04

Fixes #22207
This commit is contained in:
Robert Maynard
2021-05-27 14:14:49 -04:00
parent c5657a2fe4
commit e609afeb5f
8 changed files with 977 additions and 6 deletions

View File

@@ -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()