title: How to add a dependency on a file for the configure step of ExternalProject_Add in cmake
body: <p>I'm trying to add an external project, that doesn't use cmake, to my project that <em>does</em> use cmake: </p>
  
  <pre><code>include(ExternalProject)
  
  ExternalProject_Add( MatrixSSL
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/matrixssl
    PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matrixssl
    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/configure_matrixssl.sh
    BUILD_COMMAND echo "Built!"
    INSTALL_COMMAND echo "Installing!"
  )
  </code></pre>
  
  <p>Here the script <code>${CMAKE_CURRENT_SOURCE_DIR}/configure_matrixssl.sh</code> will do
  whatever is required to configure that external project (aka, generate the Makefile's).</p>
  
  <p>My problem is that when I edit <code>configure_matrixssl.sh</code> and re-run 'make', then
  the configure step is <em>not</em> repeated. Therefore I want to add a dependency of
  the 'configure step' on my script; when the modification time of my script is newer
  than the modification time of the configure timestamp file, it should redo the
  configuration step.</p>
  
  <p>I tried,</p>
  
  <pre><code>ExternalProject_Add_Step( MatrixSSL configure
    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/configure_matrixssl.sh
  )
  </code></pre>
  
  <p>but this has no effect.</p>
  
  <p>Then I tried,</p>
  
  <pre><code>ExternalProject_Add_Step( MatrixSSL configure
    COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/configure_matrixssl.sh   
    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/configure_matrixssl.sh
  )
  </code></pre>
  
  <p>but that gives me the error</p>
  
  <blockquote>
    <p>CMake Error: Attempt to add a custom rule to output "/home/carlo/projects/aicxx/ai-evio-testsuite/ai-evio-testsuite-objdir/evio/matrixssl/src/MatrixSSL-stamp/MatrixSSL-configure.rule" which already has a custom rule.</p>
  </blockquote>
  
  <p>Removing the <code>CONFIGURE_COMMAND</code> from the <code>ExternalProject_Add</code> has no effect.</p>
  
  <p>How can I do this?</p>