1
0
Fork 0

Fix version parsing for stable version.

This commit is contained in:
John Preston 2019-12-31 17:38:39 +03:00
parent 1dd11ff72a
commit b08c57c8d0

View file

@ -17,25 +17,30 @@ function(desktop_app_parse_version file)
endif()
endforeach()
if (NOT ${version} MATCHES "[0-9]+\.[0-9]+(\.[0-9]+(\.([0-9]+|beta)))")
if (NOT ${version} MATCHES "[0-9]+\.[0-9]+(\.[0-9]+(\.([0-9]+|beta))?)?")
message(FATAL_ERROR "Bad version: ${version}, check ${file}")
endif()
message("Version: ${version}")
set(beta 0)
set(beta_bool "false")
set(alpha 0)
string(REPLACE "." ";" components ${version})
list(LENGTH components components_count)
list(GET components 0 major)
list(GET components 1 minor)
list(GET components 2 patch)
list(GET components 3 alpha)
if (${alpha} STREQUAL beta)
set(beta 1)
set(beta_bool "true")
set(alpha 0)
else()
set(beta 0)
set(beta_bool "false")
if (${components_count} GREATER 2)
list(GET components 2 patch)
if (${components_count} GREATER 3)
list(GET components 3 alpha)
if (${alpha} STREQUAL beta)
set(beta 1)
set(beta_bool "true")
set(alpha 0)
endif()
endif()
endif()
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "")