title: CMake: trigger regeneration of Makefiles when environment variable changes
body: <p>I am using Linux, CMake, and Conda, which is a package manager that edits <code>$PATH</code> as a way to switch between "environments."  This means when I run a special command in Conda, <code>$PATH</code> points to a different compiler.  <code>$CONDA_PREFIX</code> is also changed.</p>
  
  <p>By default, CMake is not sensitive to these changes.  I would like it to be.  Specifically, I want CMake to automatically regenerate all Makefiles when a different GCC is found in <code>$PATH</code>, or alternatively when <code>$CONDA_PREFIX</code> has changed since the last explicit <code>cmake</code> invocation.  This regeneration would be similar to what CMake does when you edit the top-level <code>CMakeLists.txt</code> file - the next time you run <code>make</code> it regenerates everything.</p>
  
  <p>How can I do this in a simple way using CMake?</p>