From 2efcbcb2e67e696e02757fa8d12638aa2df656c5 Mon Sep 17 00:00:00 2001 From: 4lex4 <4lex49@zoho.com> Date: Thu, 15 Aug 2019 20:27:37 +0300 Subject: [PATCH] ~ Fix cmake version extraction --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2baf9581..cff073ae1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,9 +265,9 @@ if ("${VERSION_QUAD}" STREQUAL "${version_h_contents}") message(FATAL_ERROR "Failed to extract VERSION_QUAD from version.h") endif() configure_file(version.h.in "${CMAKE_BINARY_DIR}/version.h" COPYONLY) -string(REGEX REPLACE "(.*)\\..*\\..*" "\\1" APPLICATION_VERSION_MAJOR "${VERSION}") -string(REGEX REPLACE ".*\\.(.*)\\..*" "\\1" APPLICATION_VERSION_MINOR "${VERSION}") -string(REGEX REPLACE ".*\\..*\\.(.*)" "\\1" APPLICATION_VERSION_PATCH "${VERSION}") +string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" APPLICATION_VERSION_MAJOR "${VERSION}") +string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" APPLICATION_VERSION_MINOR "${VERSION}") +string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" APPLICATION_VERSION_PATCH "${VERSION}") set(SCANTAILOR_RESOURCES_DIR "${CMAKE_SOURCE_DIR}/src/resources") set(SCANTAILOR_TRANSLATIONS_DIR "${CMAKE_SOURCE_DIR}/src/translations")