Skip to content

file(COPY_FILE): Add option to retry on Windows if input access fails

Brad King requested to merge brad.king/cmake:file-COPY_FILE-retry into master

On Windows, a file may be inaccessible for a short time after it is created. This occurs for various reasons, including indexing, antivirus tools, and NTFS's asynchronous semantics. Add an INPUT_MAY_BE_RECENT option to tell CMake that the input file may have been recently created so that we can retry a few times to read it.

Use the option in the ExternalData module implementation to improve robustness on Windows. Hopefully this will resolve our long-standing spurious failures of the Module.ExternalData test on Windows.

Edited by Brad King

Merge request reports