I have a build rule that copies files from the source tree to the build tree:<br><br>foreach( script ${scripts} )<br> set( src "${CMAKE_CURRENT_SOURCE_DIR}/${script}" )<br> set( dest "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${script}" )<br>
list( APPEND dest_files "${dest}" )<br> add_custom_command( <br> OUTPUT "${dest}"<br> COMMAND ${CMAKE_COMMAND} -E copy "${src}" "${dest}"<br> MAIN_DEPENDENCY "${src}"<br>
COMMENT "Copying ${src} to ${dest}"<br> VERBATIM<br> )<br>endforeach()<br><br>add_custom_target( copy_scripts<br> ALL<br> DEPENDS ${dest_files}<br> )<br><br>This then runs commands such as this:<br>"C:\Program Files (x86)\Programming\CMake 2.6\bin\cmake.exe" -E copy C:/code/rtsdk/rtmain/tests/Regression/scripts/correctness.rb C:/code/rtsdk/rtmain/build-32-vs9-c32/bin/correctness.rb<br>
<br>The problem I'm having is that when I go and do a make clean, I get errors that the destination files are read only. This isn't unexpected as the source files are read only, but how do I work around this file permission issue in a portable way?<br>
<br>I don't want to use configure file, because I want the files to be copied at build time and not configure time.<br><br>Thanks,<br>James<br><br>