I added
version.target = version.h version.commands = bash generate-version.sh QMAKE_EXTRA_TARGETS += version PRE_TARGETDEPS += version.h
This works and is easy to understand.
version.commands = ( cd $${PWD}; generate-version.sh )