From 378874635cad7631eef251c9393c220594dbfb17 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Tue, 18 Mar 2025 17:26:10 +0000 Subject: [PATCH] Fix create_version_h.sh for out of tree builds When building out of tree generated version.sh contains empty version. This patch fixes the issue by using subshell to change directory to the git tree from which cmake takes the sources. The fix only applies to building BCU on Posix compliant systems. Signed-off-by: Milosz Wasilewski --- create_version_h.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create_version_h.sh b/create_version_h.sh index e777359..de2d8d6 100755 --- a/create_version_h.sh +++ b/create_version_h.sh @@ -4,8 +4,8 @@ if [ "${APPVEYOR_BUILD_VERSION}" = "" ]; then echo build not in appveyor else - git tag ${APPVEYOR_BUILD_VERSION} + (cd "${1}"; git tag ${APPVEYOR_BUILD_VERSION}) fi -version=`git describe --tags --long` +version=$(cd "${1}"; git describe --tags --long) echo "#define GIT_VERSION \"$version\"" > ${1}/version.h