[CMake] cmake -E copy with file permission changes

Glenn Coombs glenn.coombs at gmail.com
Tue Jan 31 16:58:58 EST 2012


We have recently switched from cvs to perforce and encountered the same
problem.  In our case the fix was to change the CMakeList.txt file to refer
directly to the file in the source tree rather than first copying it to the
build tree and then referring to it there.  As the clean command only
affects the build tree the problem goes away - the read only file remains
in the source tree and is not required to be cleaned anymore.

--
Glenn

On 31 January 2012 17:32, James Bigler <jamesbigler at gmail.com> wrote:

> We use perforce for our source control, and perforce typically syncs files
> as read only until you check them out for editing.
>
> During our build process we copy a few scripts from the source tree to the
> build tree using 'cmake -E copy' in an 'add_custom_command'.  This works
> famously until we try to run a clean command from within Visual Studio.  At
> this point VS complains that it can't remove a read only file.
>
> Has anyone else run into this problem?
>
> There doesn't seem to be a way to use 'cmake -E' to change permissions.
> Would I have to create my own cmake script to run 'configure_file COPYONLY'?
>
> Thanks,
> James
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120131/7712f872/attachment.htm>


More information about the CMake mailing list