I'm looking to trigger a CMake configure to occur when the output of a command changes; Specifically I am looking at trying to make CMake configure when the output of git describe --always --dirty
has change from the previous time CMake was configured.
Most of this problem can be solved by watching the HEAD
file and resolving the symref inside to refs/heads/[branch]
and linking these with configure_file(...)
however this doesn't pick up on when the tree is in a dirty state (I.E. when there are uncommitted modifications). In this instance git describe --always --dirty
will append the -dirty
suffix to the output.
When this occurs there are no changes to the git files, only that git has noticed differences from the stored state so I can't configure_file(...)
on any files here to get cmake to notice the change and reconfigure.
So I'm looking to find if there is a way to get cmake to run the git command notice the difference in output and trigger a reconfigure, almost need something akin to a pre-reconfigure-check stage.
Not sure if this is possible of if anyone has any ideas how else this behaviour can be achieved?