title: CMake add_custom_command has no effect if output file exists
body: <p>I need to generate a couple of files from txt base file. But if these files already exist, NMake Makefiles generator just omits generation command:</p>
  
  <p>CMakeLists.txt:</p>
  
  <pre><code>add_custom_command(OUTPUT "FILE.FI" "FILE.h"
                     COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../../Tools/GEN.exe
                     DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/FILE.txt"
                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
  </code></pre>
  
  <hr>
  
  <p><strong>There are no generated files</strong></p>
  
  <p>Filesystem:</p>
  
  <pre><code>FILE.txt
  </code></pre>
  
  <p>build.make</p>
  
  <pre><code>...
  D:\Path\To\Project\..\..\Tools\GEN.exe 
  ...
  </code></pre>
  
  <hr>
  
  <p><strong>Generated files exist</strong></p>
  
  <p>But if <code>FILE.FI</code> and <code>FILE.h</code> exist:</p>
  
  <p>Filesystem:</p>
  
  <pre><code>FILE.txt
  FILE.FI
  FILE.h
  </code></pre>
  
  <p>build.make:</p>
  
  <pre><code>...
  </code></pre>
  
  <p>So, my question is: How to force CMake update existing files? </p>
  
  <p><strong>P.S.</strong> I've tried to add </p>
  
  <pre><code>file(REMOVE "FILE.FI" "FILE.h")
  </code></pre>
  
  <p>to CMakeLists.txt. It works, but seems like hack.</p>