diff --git a/CMakeLists.txt b/CMakeLists.txt index fef9d4bc1..52ec92a51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,12 +47,10 @@ include(VcPkgManifestFeatures) # 1. Properties such as `TARGET_SUPPORTS_SHARED_LIBS` are defined. # 2. Toolchain file is evaluated, required for `Platforms.cmake`, # which can override the options. -if(NOT VERSION_NUM) - file(STRINGS "VERSION" VERSION_STR) - if(NOT "${VERSION_STR}" STREQUAL "") - string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+)(.*)?" VERSION_PREFIX ${VERSION_STR}) - set(VERSION_NUM ${CMAKE_MATCH_1}) - endif() +file(STRINGS "VERSION" VERSION_STR) +if(NOT "${VERSION_STR}" STREQUAL "") + string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+).*" VERSION_PREFIX ${VERSION_STR}) + set(VERSION_NUM ${CMAKE_MATCH_1}) endif() if(NOT VERSION_SUFFIX)