1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

file(GLOB): Make CONFIGURE_DEPENDS mismatch more verbose

Expand the `-- GLOB mismatch!` message to print what is different.
This commit is contained in:
Daniel Hannon
2025-07-10 12:57:58 +01:00
committed by Brad King
parent a4d82a5a6d
commit 9f28c02056

View File

@@ -69,6 +69,22 @@ bool cmGlobVerificationManager::SaveVerificationScript(std::string const& path,
verifyScriptFile << "if(NOT \"${NEW_GLOB}\" STREQUAL \"${OLD_GLOB}\")\n"
<< " message(\"-- GLOB mismatch!\")\n"
<< " set(NEW_ONLY ${NEW_GLOB})\n"
<< " set(OLD_ONLY ${OLD_GLOB})\n"
<< " list(REMOVE_ITEM NEW_ONLY ${OLD_GLOB})\n"
<< " list(REMOVE_ITEM OLD_ONLY ${NEW_GLOB})\n"
<< " if(NEW_ONLY)\n"
<< " message(\"The following files were added:\")\n"
<< " foreach(VAR_FILE IN LISTS NEW_ONLY)\n"
<< " message(\" +${VAR_FILE}\")\n"
<< " endforeach()\n"
<< " endif()\n"
<< " if(OLD_ONLY)\n"
<< " message(\"The following files were removed:\")\n"
<< " foreach(VAR_FILE IN LISTS OLD_ONLY)\n"
<< " message(\" -${VAR_FILE}\")\n"
<< " endforeach()\n"
<< " endif()\n"
<< " file(TOUCH_NOCREATE \"" << stampFile << "\")\n"
<< "endif()\n";
}