[CMake] file(COPY) is copying even if file hasn't changed

Robert Dailey rcdailey.lists at gmail.com
Thu Jul 20 12:00:37 EDT 2017


FYI I decided to file an issue for this here:
https://gitlab.kitware.com/cmake/cmake/issues/17087

On Wed, Jul 19, 2017 at 4:05 PM, Robert Dailey <rcdailey.lists at gmail.com> wrote:
> Oh also file(INSTALL) does the same thing; the "Installing:" message
> gets printed each time for the same file, and never says that it is
> "up to date".
>
> On Wed, Jul 19, 2017 at 4:04 PM, Robert Dailey <rcdailey.lists at gmail.com> wrote:
>> According to the documentation for file(COPY) [1]: "Copying preserves
>> input file timestamps, and optimizes out a file if it exists at the
>> destination with the same timestamp"
>>
>> However this is not the case. My host OS is Windows 10 and I'm using
>> CMake 3.9.0-rc5. Each time my CMakeLists.txt is run, the file(COPY) is
>> copying over the file even if it didn't change. The "date modified"
>> timestamp for the destination file is updated. I do not want the copy
>> to occur if the source file has not changed (this appears to be the
>> intended behavior based on the documentation).
>>
>> Am I understanding this correctly or is this a bug?
>>
>> [1]: https://cmake.org/cmake/help/latest/command/file.html


More information about the CMake mailing list