Commit 02fbe408 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'cmake-timestamp-error'


 cmake: Improve error message when failing to update generation timestamp

Acked-by: Kitware Robot's avatarKitware Robot <>
Merge-request: !6021
parents 6f7ab690 835896e9
......@@ -3074,12 +3074,16 @@ static bool cmakeCheckStampFile(const std::string& stampName)
cmsys::ofstream stamp(stampTemp.c_str());
stamp << "# CMake generation timestamp file for this directory.\n";
if (cmSystemTools::RenameFile(stampTemp, stampName)) {
std::string err;
if (cmSystemTools::RenameFile(stampTemp, stampName,
cmSystemTools::Replace::Yes, &err) ==
cmSystemTools::RenameResult::Success) {
// CMake does not need to re-run because the stamp file is up-to-date.
return true;
cmSystemTools::Error("Cannot restore timestamp " + stampName);
cmStrCat("Cannot restore timestamp \"", stampName, "\": ", err));
return false;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment