Fix version parsing for stable version.
This commit is contained in:
parent
1dd11ff72a
commit
b08c57c8d0
1 changed files with 16 additions and 11 deletions
|
|
@ -17,25 +17,30 @@ function(desktop_app_parse_version file)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
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}")
|
message(FATAL_ERROR "Bad version: ${version}, check ${file}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message("Version: ${version}")
|
message("Version: ${version}")
|
||||||
|
|
||||||
|
set(beta 0)
|
||||||
|
set(beta_bool "false")
|
||||||
|
set(alpha 0)
|
||||||
|
|
||||||
string(REPLACE "." ";" components ${version})
|
string(REPLACE "." ";" components ${version})
|
||||||
|
list(LENGTH components components_count)
|
||||||
list(GET components 0 major)
|
list(GET components 0 major)
|
||||||
list(GET components 1 minor)
|
list(GET components 1 minor)
|
||||||
list(GET components 2 patch)
|
if (${components_count} GREATER 2)
|
||||||
list(GET components 3 alpha)
|
list(GET components 2 patch)
|
||||||
|
if (${components_count} GREATER 3)
|
||||||
if (${alpha} STREQUAL beta)
|
list(GET components 3 alpha)
|
||||||
set(beta 1)
|
if (${alpha} STREQUAL beta)
|
||||||
set(beta_bool "true")
|
set(beta 1)
|
||||||
set(alpha 0)
|
set(beta_bool "true")
|
||||||
else()
|
set(alpha 0)
|
||||||
set(beta 0)
|
endif()
|
||||||
set(beta_bool "false")
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
|
if (DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue