[CMake] cmake -E move/rename?

Brad King brad.king at kitware.com
Mon Jun 29 10:18:04 EDT 2009


Marcel Loose wrote:
> Ah, must not have been the only one wondering ;-)
> 
> Do you, by any change, know if renames can also be done across
> directories -- i.e. rename <file> <dest-dir> -- or does it only support
> file-to-file and dir-to-dir rename?

It is just a wrapper around the posix 'rename' function.  The source
and destination must be of the same type.  It does work across dirs
but they must be in the same disk volume.  It is intended for use in
performing atomic updates.  There is also a CMake-language version:

   file(RENAME <oldname> <newname>)

   RENAME moves a file or directory within a filesystem, replacing
   the destination atomically.

> Is this scheduled for release 2.6.5, or is it a 2.8 feature?

The 2.6 branch is now only for bug fixes and documentation improvements.
It will be in 2.8.

-Brad


More information about the CMake mailing list