Fix the path used for ignoring system warnings

This commit is contained in:
Ben Boeckel 2010-09-14 17:14:25 -04:00
parent 056b44113f
commit ae3eff35b4
1 changed files with 3 additions and 4 deletions

View File

@ -1766,13 +1766,12 @@ bool cmMakefile::CheckForUnused(const char* reason, const char* name)
{
if (this->WarnUnused && !this->VariableUsed(name))
{
const char* cdir = this->ListFileStack.back().c_str();
const cmListFileContext* file = this->CallStack.back().Context;
if (this->CheckSystemVars ||
cmSystemTools::IsSubDirectory(cdir, this->GetHomeDirectory()) ||
cmSystemTools::IsSubDirectory(cdir, this->GetHomeOutputDirectory()))
cmSystemTools::IsSubDirectory(file->FilePath.c_str(), this->GetHomeDirectory()) ||
cmSystemTools::IsSubDirectory(file->FilePath.c_str(), this->GetHomeOutputDirectory()))
{
cmOStringStream msg;
const cmListFileContext* file = this->CallStack.back().Context;
msg << file->FilePath << ":" << file->Line << ":" <<
" warning: (" << reason << ") unused variable \'" << name << "\'";
cmSystemTools::Message(msg.str().c_str());