Skip to content

Commit

Permalink
Prepare for next development cycle
Browse files Browse the repository at this point in the history
This change prepares the repo for developing the 2.0.0-beta3.
The CMake configuration required an update to handle both
a beta and dev suffix in the version string.
  • Loading branch information
erimatnor committed May 27, 2020
1 parent 57bc2e6 commit f923a8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Expand Up @@ -30,19 +30,25 @@ endfunction()

configure_file("version.config" "version.config" COPYONLY)
file(READ version.config VERSION_CONFIG)
set(VERSION_REGEX "version[\t ]*=[\t ]*([0-9]+\\.[0-9]+\\.*[0-9]*)([-]([a-z]+[0-9]*))*\r?\nupdate_from_version[\t ]*=[\t ]*([0-9]+\\.[0-9]+\\.*[0-9]*)([-]([a-z]+[0-9]*))*(\r?\n)*$")
set(VERSION_REGEX "version[\t ]*=[\t ]*([0-9]+\\.[0-9]+\\.*[0-9]*)([-]([a-z]+[0-9]*))?([-](dev))?\r?\nupdate_from_version[\t ]*=[\t ]*([0-9]+\\.[0-9]+\\.*[0-9]*)([-]([a-z]+[0-9]*))*(\r?\n)*$")

if (NOT (${VERSION_CONFIG} MATCHES ${VERSION_REGEX}))
message(FATAL_ERROR "Cannot read version from version.config")
endif ()

# a hack to avoid change of SQL extschema variable
set(extschema "@extschema@")
set(VERSION ${CMAKE_MATCH_1})
set(VERSION_MOD ${CMAKE_MATCH_3})
set(UPDATE_FROM_VERSION ${CMAKE_MATCH_4})
set(VERSION_DEV ${CMAKE_MATCH_5})
set(UPDATE_FROM_VERSION ${CMAKE_MATCH_6})

if (VERSION_MOD)
if (VERSION_MOD AND VERSION_DEV)
set(PROJECT_VERSION_MOD ${VERSION}-${VERSION_MOD}-${VERSION_DEV})
elseif (VERSION_MOD)
set(PROJECT_VERSION_MOD ${VERSION}-${VERSION_MOD})
elseif (VERSION_DEV)
set(PROJECT_VERSION_MOD ${VERSION}-${VERSION_DEV})
else ()
set(PROJECT_VERSION_MOD ${VERSION})
endif ()
Expand Down
2 changes: 1 addition & 1 deletion version.config
@@ -1,2 +1,2 @@
version = 2.0.0-beta2
version = 2.0.0-beta3-dev
update_from_version = 1.7.1

0 comments on commit f923a8a

Please sign in to comment.