The current setup uses cmake's execute_process() call to generate version information. This only executes when a new build directory is set up, so if the code is modified and recompiled the information is out of date.
Here I've copied over the system we use with Galform. The version information is put in a generated source file which has dependencies on all of the other source files so that it will be regenerated as necessary. If git is not found or we're not in a git repository then the branch name and commit hash will show as "not available".
The current setup uses cmake's execute_process() call to generate version information. This only executes when a new build directory is set up, so if the code is modified and recompiled the information is out of date.
Here I've copied over the system we use with Galform. The version information is put in a generated source file which has dependencies on all of the other source files so that it will be regenerated as necessary. If git is not found or we're not in a git repository then the branch name and commit hash will show as "not available".