Extract version from CMakeLists.txt in update-version-h.sh

Since autotools build system was removed, configure.ac is no longer
available while the script is still being used by the Xcode project.

Fixes: #1553
This commit is contained in:
Mike Gelfand 2020-12-17 16:04:29 +03:00
parent 33620417f6
commit 47f3e68169
1 changed files with 2 additions and 2 deletions

View File

@ -12,9 +12,9 @@ replace_if_differs() {
echo "creating libtransmission/version.h"
user_agent_prefix=$(grep m4_define configure.ac | sed "s/[][)(]/,/g" | grep user_agent_prefix | cut -d , -f 6)
user_agent_prefix=$(grep 'set[(]TR_USER_AGENT_PREFIX' CMakeLists.txt | cut -d \" -f 2)
peer_id_prefix=$(grep m4_define configure.ac | sed "s/[][)(]/,/g" | grep peer_id_prefix | cut -d , -f 6)
peer_id_prefix=$(grep 'set[(]TR_PEER_ID_PREFIX' CMakeLists.txt | cut -d \" -f 2)
major_version=$(echo "${user_agent_prefix}" | awk -F . '{print $1}')
minor_version=$(echo "${user_agent_prefix}" | awk -F . '{print $2 + 0}')