From a0171b1b5a59464df57e10128548afb70382e5a5 Mon Sep 17 00:00:00 2001 From: Andrew James Date: Tue, 10 Sep 2024 00:33:27 +1000 Subject: [PATCH] Don't use user-supplied VERSION_NUM when building DevilutionX (#7411) --- CMakeLists.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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)