The "^" character has a special meaning to the Windows shell, roughly the same as the backslash escape in C++ or bash shell. It looks like it is being consumed with the result that the command being executed is this:
svn info -r HEAD ../ | sed -n "/Revision/p" | sed "s/[0-9]//g"
svn info -r HEAD ../ | sed -n "/Revision/p" | sed "s/[0-9]//g"
To copy to clipboard, switch view to plain text mode
which gives the output you complain of by removing the digits. Try:
SVNVERSION = $$system(svn info -r HEAD ../ | sed -n "/Revision/p" | sed "s/[^^0-9]//g")
DEFINES += VER=$${SVNVERSION}
SVNVERSION = $$system(svn info -r HEAD ../ | sed -n "/Revision/p" | sed "s/[^^0-9]//g")
DEFINES += VER=$${SVNVERSION}
To copy to clipboard, switch view to plain text mode
(which is only good on Windows).
Depending on the Subversion command line utilities you have to work with:
SVNVERSION = $$system(svnversion ../)
SVNVERSION = $$system(svnversion ../)
To copy to clipboard, switch view to plain text mode
might also work for you.
If you are using TortoiseSVN then it is possible to script this using its exposed objects.
BTW: This will only extract the version when you run qmake, and not every time you build.
Bookmarks