Qt 2009.01 (4.5)

I'm trying to automatically include the revision number in a build of a Qt project, specifically with Qt Creator. I.E. I want to include a label in an About dialog that shows what build number the executable is from. My head is about to explode, I've tried so many things.

I know about 'svnversion .' I'm trying to make it play nicely with qmake and/or the .pro file, without success. The subversion faq says:
Qt Code:
  1. ##
  2. ## To use this, in yourfile.c do something like this:
  3. ## printf("this program was compiled from SVN revision %s\n",SVN_REV);
  4. ##
  5.  
  6. SVNDEF := -D'SVN_REV="$(shell svnversion -n .)"'
  7. CFLAGS := $(SVNDEF) ... continue with your other flags ...
To copy to clipboard, switch view to plain text mode 
But I can't put that in the .pro file. I did find an old thread where someone said to put this in a .pro file:
Qt Code:
  1. # Subversion revisions
  2. QMAKE_EXTRA_TARGETS += revtarget
  3. PRE_TARGETDEPS += version.h
  4. revtarget.target = version.h
  5. revtarget.commands = @echo "const char *revision = \"$(shell svnversion .)\";" > $$revtarget.target
  6. revtarget.depends = $$SOURCES $$HEADERS $$FORMS
To copy to clipboard, switch view to plain text mode 
But that also doesn't work. The command `svnversion .` never actually gets executed (QtCreator output says 'CreateProcess failed(null,svnversion...'), and the version.h file is only written if it previously didn't exist.

Any help would be appreciated. It seems this should be a simple task. Maybe I'm making it more complicated than it is?