Feature request: Add --preserve-timestamps option to cmake --install
I have a repository with code for a bunch of related, but independent, features. I want to:
- Create N different tarballs with the source code, each one of them with a different set of features.
- Build from those tarballs in my CI.
I want to create the source code tarballs with CPack. package_source
is too limited to generate what I want, but I can use the package
target even if what I'm packaging is sources, not binary.
The problem is that package
will install all files that have been installed via CMake’s install() command
. And the install()
command, unlike file(COPY)
, doesn't preserve the timestamps. I would like to preserver timestamps to avoid unnecessary rebuilds in my CI.
Could a cmake --install --preserve-timestamps
flag be added? A normal install would keep using normal timestamps, an user could override it and cpack
... would probably call it with the flag to make the generated tarballs more reproducible?