Fix build_number.h not being created properly

This commit is contained in:
Mark Watkins 2014-07-09 16:39:44 +10:00
parent 7e7d87f143
commit 74a9b3379b
3 changed files with 30 additions and 17 deletions

View File

@ -1 +0,0 @@
47

View File

@ -1,12 +1,24 @@
#!/bin/bash
MY_PATH="`dirname \"$0\"`"
if [ ! -f "$MY_PATH/ReleaseMode" ]
if [ -f "$MY_PATH/build_number" ]
then
echo "Skipping build number update"
exit;
fi
echo "Updating build number"
number=`cat $MY_PATH/build_number`
let number++
echo "$number" > $MY_PATH/build_number
echo "const int build_number = ""$number;" | tee $MY_PATH/../build_number.h
else
number=0
fi
if [ ! "$1" == "release" ]
then
echo "Updating build number"
let number++
echo "$number" > $MY_PATH/build_number
echo "const int build_number = ""$number;" | tee $MY_PATH/../build_number.h
else
echo "Skipping build number update"
# But create anyway if it doesn't exist
if [ ! -f $MY_PATH/../build_number.h ]
then
echo "const int build_number = ""$number;" | tee $MY_PATH/../build_number.h
fi
fi

View File

@ -100,15 +100,17 @@ win32 {
}
unix {
CONFIG(release, debug|release) {
# Update build number
build_nr.commands = $$PWD/scripts/inc_build.sh
build_nr.depends = FORCE
QMAKE_EXTRA_TARGETS += build_nr
PRE_TARGETDEPS += build_nr
HEADERS += build_number.h
# Update build number
CONFIG(release, debug|release) {
build_nr.commands = $$PWD/scripts/inc_build.sh release
} else {
build_nr.commands = $$PWD/scripts/inc_build.sh debug
}
build_nr.depends = FORCE
QMAKE_EXTRA_TARGETS += build_nr
PRE_TARGETDEPS += build_nr
HEADERS += build_number.h
}
#include(..3rdparty/qextserialport/src/qextserialport.pri)