title: CMake: How to have a target for copying files
body: <p>I am using the following command to copy config files into the build directory after each compile. </p>
  
  <pre><code># Gather list of all .xml and .conf files in "/config"
  file(GLOB ConfigFiles ${CMAKE_SOURCE_DIR}/config/*.xml
                        ${CMAKE_SOURCE_DIR}/config/*.conf)
  
  foreach(ConfigFile ${ConfigFiles})
    add_custom_command(TARGET MyTarget PRE_BUILD
                       COMMAND ${CMAKE_COMMAND} -E
                           copy ${ConfigFile} $&lt;TARGET_FILE_DIR:MyTarget&gt;)
  endforeach()
  </code></pre>
  
  <p>This action is triggered every time I compile the project. Is it possible to create a target in CMakeLists.txt to copy files without needing to compile anything? Something like "make copy".</p>