diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2010-12-07 21:38:25 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2010-12-07 21:38:25 (GMT) |
commit | 668e005db5d9cece95965e23b8c589bd50a29faa (patch) | |
tree | 19bd380b41f2f35a5c6f779a19a063e62b969246 /Source/cmMakefile.cxx | |
parent | 88cd4c1e923817f0a38bbc9d14d0bf40a2151897 (diff) | |
download | CMake-668e005db5d9cece95965e23b8c589bd50a29faa.zip CMake-668e005db5d9cece95965e23b8c589bd50a29faa.tar.gz CMake-668e005db5d9cece95965e23b8c589bd50a29faa.tar.bz2 |
Use cmake::IssueMessage for warnings
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 016d5fe..e22ade3 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1777,18 +1777,21 @@ void cmMakefile::CheckForUnused(const char* reason, const char* name) const if (this->WarnUnused && !this->VariableUsed(name)) { cmStdString path; - long line; + cmListFileBacktrace bt; if (this->CallStack.size()) { const cmListFileContext* file = this->CallStack.back().Context; + bt.push_back(*file); path = file->FilePath.c_str(); - line = file->Line; } else { path = this->GetStartDirectory(); path += "/CMakeLists.txt"; - line = 0; + cmListFileContext lfc; + lfc.FilePath = path; + lfc.Line = 0; + bt.push_back(lfc); } if (this->CheckSystemVars || cmSystemTools::IsSubDirectory(path.c_str(), @@ -1799,9 +1802,10 @@ void cmMakefile::CheckForUnused(const char* reason, const char* name) const cmake::GetCMakeFilesDirectory()))) { cmOStringStream msg; - msg << path << ":" << line << ":" << - " CMake Warning: (" << reason << ") unused variable \'" << name << "\'"; - cmSystemTools::Message(msg.str().c_str()); + msg << "unused variable (" << reason << ") \'" << name << "\'"; + this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, + msg.str().c_str(), + bt); } } } |