Add a method to put a watch for variables

This commit is contained in:
Ben Boeckel 2010-09-22 12:42:49 -04:00
parent 535253f385
commit 33c63b19ab
2 changed files with 10 additions and 4 deletions

View File

@ -380,10 +380,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
"No help, variable specified on the command line.", type);
if(this->WarnUnusedCli)
{
#ifdef CMAKE_BUILD_WITH_CMAKE
this->VariableWatch->AddWatch(var, cmWarnUnusedCliWarning, this);
this->UsedCliVariables[var] = false;
#endif
this->WatchUnusedCli(var.c_str());
}
}
else
@ -4488,6 +4485,14 @@ int cmake::Build(const std::string& dir,
0, nativeOptions);
}
void cmake::WatchUnusedCli(const char* var)
{
#ifdef CMAKE_BUILD_WITH_CMAKE
this->VariableWatch->AddWatch(var, cmWarnUnusedCliWarning, this);
this->UsedCliVariables[var] = false;
#endif
}
void cmake::RunCheckForUnusedVariables() const
{
#ifdef CMAKE_BUILD_WITH_CMAKE

View File

@ -363,6 +363,7 @@ class cmake
const std::vector<std::string>& nativeOptions,
bool clean);
void WatchUnusedCli(const char* var);
void RunCheckForUnusedVariables() const;
protected:
void InitializeProperties();