I figured out how to generate define macro containing git hash at compile time:
DEFINES += GIT_CURRENT_SHA1="\\\"$(shell git -C \""$$_PRO_FILE_PWD_"\" describe)\\\""
The problem is that when the git hash is changed, the files (mainwindow.cpp which is adding text to about dialog) which are using the GIT_CURRENT_SHA1 are not automatically rebuilt (obviously)..
I would like to generate header file at compile time containing git hash like in const char *git_hash="git-hash-etc-etc";
And this header file I would include in mainwindow.cpp and hope it would be recompiled when the header changes..
My question is mainly what to add into .pro file to generate such file from Makefile?
Thanks.