Allow to determine the target version from the default version in the tde-cmake module.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/5/head
Slávek Banko 2 years ago
parent a810c4d292
commit 4eebab4010
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -80,7 +80,9 @@ fi
# Set target version
if [ -z "$TARGET" ]; then
if [ -f main/core/tdelibs/tdecore/tdeversion.h ]; then
if [ -f main/dependencies/tde-cmake/modules/TDEVersion.cmake ]; then
tdeversionHeader=main/dependencies/tde-cmake/modules/TDEVersion.cmake
elif [ -f main/core/tdelibs/tdecore/tdeversion.h ]; then
tdeversionHeader=main/core/tdelibs/tdecore/tdeversion.h
elif [ -f main/core/tdelibs/kdecore/kdeversion.h ]; then
tdeversionHeader=main/core/tdelibs/kdecore/kdeversion.h
@ -93,7 +95,7 @@ if [ -z "$TARGET" ]; then
echo "Cannot find TDE core headers. Exiting."
exit 1
fi
TARGET=`sed -n 's|#define [KT]DE_VERSION_STRING "[^0-9]\?\([^ "]*\).*|\1|p' $tdeversionHeader`
TARGET=`sed -n 's/^[ \t]*\(set( DEFAULT_VERSION\|#define [KT]DE_VERSION_STRING\) "[^0-9]\?\([^ ~"]*\).*/\2/p' $tdeversionHeader`
fi
export TARGET

@ -57,7 +57,9 @@ MODULE=${SUBROOT#$TDEROOT/main/}
# Set target version
if [ -z "$TARGET" ]; then
if [ -f $TDEROOT/main/core/tdelibs/tdecore/tdeversion.h ]; then
if [ -f $TDEROOT/main/dependencies/tde-cmake/modules/TDEVersion.cmake ]; then
tdeversionHeader=$TDEROOT/main/dependencies/tde-cmake/modules/TDEVersion.cmake
elif [ -f $TDEROOT/main/core/tdelibs/tdecore/tdeversion.h ]; then
tdeversionHeader=$TDEROOT/main/core/tdelibs/tdecore/tdeversion.h
elif [ -f $TDEROOT/main/core/tdelibs/kdecore/kdeversion.h ]; then
tdeversionHeader=$TDEROOT/main/core/tdelibs/kdecore/kdeversion.h
@ -70,7 +72,7 @@ if [ -z "$TARGET" ]; then
echo "Cannot find TDE core headers. Exiting."
exit 1
fi
TARGET=`sed -n 's|#define [KT]DE_VERSION_STRING "[^0-9]\?\([^ "]*\).*|\1|p' $tdeversionHeader`
TARGET=`sed -n 's/^[ \t]*\(set( DEFAULT_VERSION\|#define [KT]DE_VERSION_STRING\) "[^0-9]\?\([^ ~"]*\).*/\2/p' $tdeversionHeader`
fi
# Check branch by target

Loading…
Cancel
Save