No documented method to install via move instead of copy
I'm migrating my team's code away from an in-house build system to cmake.
The current build system puts it's artifacts in specific paths on the filesystem where other pre-existing tools expect to find them. As a result, I need to ensure that the build artifacts from cmake make it to the same place. While I am engaging with other teams about these tools to change the assumptions the tools make, that process will take a very long time to bear any fruit.
I have the install() function working to put these files into the right place, but the installation always happens via copy, instead of move. This takes a very long time, 20 minutes out of an hour-and-20 build, because of the amount of data being shuffled around. This is going to get much worse, as I have no more than 1/3rd of our code migrated to cmake so far. I expect build times to grow up to 6-8 hours, and would hate to see a full hour or more spent just on copying files during the install step.
I can't find any documentation on any of the following subjects, which would alleviate this issue:
- Build the final artifacts directly into the destination location. e.g. .obj files would be handled how they normally are, but the link step would put the resulting exe / lib in the place they'll be installed to, instead of requiring a later step to copy/move them. Ideally, other cmake family tools like ctest would continue to work properly from the build tree, even if the final artifacts actually live outside of it.
- Hardlink the file from the build tree to the installation destination. For my purposes the negatives/risks of hardlinking like this are acceptable.
- Move, instead of copy.
- Reflink, when on filesystems where that's an option. Currently I happen to be using NTFS, but supporting Linux build-hosts is on my list as well, so btrfs's CoW support with
cp --reflink=autowould be ideal for this.
If there are ways to tweak how cmake does it's installation for any of the above, then this issue is a enhancement request for the documentation at https://cmake.org/cmake/help/latest/command/install.html
If there are not currently ways to influence this, then this issue is a feature request to add a customization point for the installation behavior.