decouple version-sync script from cmake

This commit is contained in:
Carsten Brandt 2017-01-17 19:47:12 +01:00 committed by Sergey 'Jin' Bostandzhyan
parent 3520eee05d
commit 86e67f805a
2 changed files with 4 additions and 13 deletions

View File

@ -17,19 +17,6 @@ set(PROJECT_VERSION_MINOR "1")
set(PROJECT_VERSION_PATCH "4")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
# Update versions in various places
# This must be run before setting SOVERSION, because SOVERSION is read from
# a file generated by this script
find_program(SHELL NAMES sh dash bash zsh)
if(SHELL)
execute_process(
COMMAND ${SHELL} ${toxcore_SOURCE_DIR}/other/version-sync
${toxcore_SOURCE_DIR}
${PROJECT_VERSION_MAJOR}
${PROJECT_VERSION_MINOR}
${PROJECT_VERSION_PATCH})
endif()
# set .so library version / following libtool scheme
# https://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
file(STRINGS ${toxcore_SOURCE_DIR}/so.version SOVERSION_CURRENT REGEX "^CURRENT=[0-9]+$")

View File

@ -29,6 +29,10 @@ update 'toxcore/tox.api.h' 's/\(const VERSION_MAJOR *= \).*;/\1'$MAJOR';/'
update 'toxcore/tox.api.h' 's/\(const VERSION_MINOR *= \).*;/\1'$MINOR';/'
update 'toxcore/tox.api.h' 's/\(const VERSION_PATCH *= \).*;/\1'$PATCH';/'
update 'CMakeLists.txt' 's/\(PROJECT_VERSION_MAJOR "\).*"/\1'$MAJOR'"/'
update 'CMakeLists.txt' 's/\(PROJECT_VERSION_MINOR "\).*"/\1'$MINOR'"/'
update 'CMakeLists.txt' 's/\(PROJECT_VERSION_PATCH "\).*"/\1'$PATCH'"/'
#
# calculating the SO version
#