Add symbolic VERSION file

The VERSION.cmake file defines which VERSION.cmake file is included. By
changing the file that it points to, the version can be changed without it
affecting other parts of the code that use it.
This commit is contained in:
Markus Mäkelä
2018-09-10 15:11:18 +03:00
parent 8896b0275f
commit 31f6d49ddb
4 changed files with 7 additions and 6 deletions

View File

@ -16,7 +16,7 @@ endif()
# Set default values for cache entries and set the MaxScale version # Set default values for cache entries and set the MaxScale version
include(cmake/defaults.cmake) include(cmake/defaults.cmake)
include(VERSION22.cmake) include(VERSION.cmake)
include(ExternalProject) include(ExternalProject)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")

View File

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
major=`cmake -P ../../VERSION22.cmake -L|grep 'MAXSCALE_VERSION_MAJOR'|sed 's/.*=//'` major=`cmake -P ../../VERSION.cmake -L|grep 'MAXSCALE_VERSION_MAJOR'|sed 's/.*=//'`
minor=`cmake -P ../../VERSION22.cmake -L|grep 'MAXSCALE_VERSION_MINOR'|sed 's/.*=//'` minor=`cmake -P ../../VERSION.cmake -L|grep 'MAXSCALE_VERSION_MINOR'|sed 's/.*=//'`
patch=`cmake -P ../../VERSION22.cmake -L|grep 'MAXSCALE_VERSION_PATCH'|sed 's/.*=//'` patch=`cmake -P ../../VERSION.cmake -L|grep 'MAXSCALE_VERSION_PATCH'|sed 's/.*=//'`
maturity=`cmake -P ../../VERSION22.cmake -L|grep 'MAXSCALE_MATURITY'|sed 's/.*=//'` maturity=`cmake -P ../../VERSION.cmake -L|grep 'MAXSCALE_MATURITY'|sed 's/.*=//'`
VERSION=${major}.${minor}.${patch} VERSION=${major}.${minor}.${patch}

1
VERSION.cmake Normal file
View File

@ -0,0 +1 @@
include(VERSION22.cmake)

View File

@ -1,2 +1,2 @@
include(../VERSION22.cmake) include(../VERSION.cmake)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/version.js.in ${CMAKE_CURRENT_BINARY_DIR}/lib/version.js @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/version.js.in ${CMAKE_CURRENT_BINARY_DIR}/lib/version.js @ONLY)