title: How to trigger a CMake reconfigure when the output of a command changes
body: <p>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 <code>git describe --always --dirty</code> has change from the previous time CMake was configured.</p>
  
  <p>Most of this problem can be solved by watching the <code>HEAD</code> file and resolving the symref inside to <code>refs/heads/[branch]</code> and linking these with <code>configure_file(...)</code> 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 <code>git describe --always --dirty</code> will append the <code>-dirty</code> suffix to the output.</p>
  
  <p>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 <code>configure_file(...)</code> on any files here to get cmake to notice the change and reconfigure.</p>
  
  <p>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.</p>
  
  <p>Not sure if this is possible of if anyone has any ideas how else this behaviour can be achieved?</p>