title: How to tell CMake not to cache variables
body: <p>I am using CMake in to custom create files on the fly from files that exist in a specified location. This is my code:     </p>
  
  <pre><code>file(GLOB files "${path}/*.data")
  file(GLOB sidedata "${path}/*.sidedata")
  
  foreach(file ${files})
     get_filename_component(name ${file} NAME_WE)
     add_custom_command(
        OUTPUT "${name}.library"
        DEPENDS ${path} ${file} ${sidedata} ${CMAKE_CURRENT_SOURCE_DIR}/makelibrary.pl
        COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/makelibrary.pl ARGS ${sidedata} ${file}
        COMMENT "Generating ${name}.library"
     )
     add_custom_target(${name}.target ALL DEPENDS ${name}.library)
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.library DESTINATION ${somewhere})
  endforeach()
  </code></pre>
  
  <p>The issue I am seeing that the <code>files</code> and <code>sidedata</code> are cached - if a new file is added to <code>path</code> location it will not be detected; if a file is removed, the dependency check fails.</p>
  
  <p>How do I resolve this problem?</p>