From 1e79c05859f85a7b842983e50e2fc74af62906cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 10 Feb 2015 18:18:39 +0100 Subject: [PATCH] Better fix for wrong prerelease version component parsing --- libevmjit/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libevmjit/CMakeLists.txt b/libevmjit/CMakeLists.txt index 7d9a9c8be..943c64e42 100644 --- a/libevmjit/CMakeLists.txt +++ b/libevmjit/CMakeLists.txt @@ -36,8 +36,9 @@ if(${EVMJIT_VERSION_FULL} MATCHES "^v[0-9]+\\.[0-9]+") if(${NUM_VERSION_NUMBERS} GREATER 2) list(GET VERSION_NUMBERS 2 EVMJIT_VERSION_PATCH) # patch number is optional endif() - if(${NUM_VERSION_COMPONENTS} EQUAL 1 OR ${NUM_VERSION_COMPONENTS} EQUAL 3) # git describe add 2 or 0 components - list(GET VERSION_COMPONENTS 1 EVMJIT_VERSION_PRERELEASE) + if(${NUM_VERSION_COMPONENTS} GREATER 1) + list(GET VERSION_COMPONENTS 1 VERSION_PRERELEASE_CANDIDATE) + string(REGEX MATCH "^[a-zA-Z]+.*" EVMJIT_VERSION_PRERELEASE ${VERSION_PRERELEASE_CANDIDATE}) # prerelease starts with letter endif() endif() @@ -49,7 +50,7 @@ endif() configure_file(BuildInfo.h.in ${CMAKE_CURRENT_BINARY_DIR}/gen/BuildInfo.gen.h) -message(STATUS "EVM JIT version: ${EVMJIT_VERSION_MAJOR}.${EVMJIT_VERSION_MINOR}.${EVMJIT_VERSION_PATCH}-${EVMJIT_VERSION_PRERELEASE} (${EVMJIT_VERSION_FULL})") +message(STATUS "EVM JIT version: ${EVMJIT_VERSION_MAJOR}.${EVMJIT_VERSION_MINOR}.${EVMJIT_VERSION_PATCH} ${EVMJIT_VERSION_PRERELEASE} (${EVMJIT_VERSION_FULL})") add_library(${TARGET_NAME} SHARED ${SOURCES} ${HEADERS} gen/BuildInfo.gen.h) set_target_properties(${TARGET_NAME} PROPERTIES