From 33c63b19ab4f192f95c72735d810ef3921370d1f Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 22 Sep 2010 12:42:49 -0400 Subject: [PATCH] Add a method to put a watch for variables --- Source/cmake.cxx | 13 +++++++++---- Source/cmake.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 007f52dc7..cb68f2212 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -380,10 +380,7 @@ bool cmake::SetCacheArgs(const std::vector& 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 diff --git a/Source/cmake.h b/Source/cmake.h index 4277bdd01..72effd38d 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -363,6 +363,7 @@ class cmake const std::vector& nativeOptions, bool clean); + void WatchUnusedCli(const char* var); void RunCheckForUnusedVariables() const; protected: void InitializeProperties();