Merge topic 'file-remove-no-empty'

a1eb03569d file: Change REMOVE to ignore empty names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3349
This commit is contained in:
Craig Scott
2019-05-22 12:57:15 +00:00
committed by Kitware Robot
6 changed files with 29 additions and 1 deletions
+6
View File
@@ -1404,6 +1404,12 @@ bool cmFileCommand::HandleRemove(std::vector<std::string> const& args,
cmMakeRange(args).advance(1)) // Get rid of subcommand
{
std::string fileName = arg;
if (fileName.empty()) {
std::string const r = recurse ? "REMOVE_RECURSE" : "REMOVE";
this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING,
"Ignoring empty file name in " + r + ".");
continue;
}
if (!cmsys::SystemTools::FileIsFullPath(fileName)) {
fileName = this->Makefile->GetCurrentSourceDirectory();
fileName += "/" + arg;