[CMake] cmake -E copy with file permission changes

Eric Noulard eric.noulard at gmail.com
Tue Jan 31 13:06:34 EST 2012


2012/1/31 James Bigler <jamesbigler at gmail.com>:
> 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?

nope. Is the file read-only in the source tree?

> 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'?

I would suggest a script using file(COPY ...)
this one has convenient option like "USE_SOURCE_PERMISSIONS", "PERMISSIONS" ...

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list