Allow directory names containing '=' and warn if necessary (#12934)

The approach taken by commit 8704525f (Reject directory names containing
'=', 2011-01-14) was perhaps too heavy-handed for avoiding the obscure
cases when '=' in the path fails due to limitations of Make syntax.
Only two CMake tests:

  LinkDirectory
  OutOfSource

fail when the path contains '=' and they cover obscure cases.  Instead
of rejecting such paths outright just warn when the problem may occur.
This commit is contained in:
Brad King
2012-02-06 09:40:42 -05:00
parent 8704525f20
commit c8ef6430e0
3 changed files with 15 additions and 26 deletions

View File

@@ -561,6 +561,21 @@ cmLocalUnixMakefileGenerator3
space = " ";
}
// Warn about paths not supported by Make tools.
std::string::size_type pos = tgt.find_first_of("=");
if(pos != std::string::npos)
{
cmOStringStream m;
m <<
"Make rule for\n"
" " << tgt << "\n"
"has '=' on left hand side. "
"The make tool may not support this.";
cmListFileBacktrace bt;
this->GlobalGenerator->GetCMakeInstance()
->IssueMessage(cmake::WARNING, m.str(), bt);
}
// Mark the rule as symbolic if requested.
if(symbolic)
{