From 995cfb0e2a4d2787371f87568bc943e6ad34d55c Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 16 Sep 2010 13:52:17 -0400 Subject: Don't warn if the variable wasn't defined --- Source/cmMakefile.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a7f86ae..1e12658 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1783,8 +1783,13 @@ void cmMakefile::CheckForUnused(const char* reason, const char* name) const void cmMakefile::RemoveDefinition(const char* name) { this->Internal->VarStack.top().Set(name, 0); + if (this->Internal->VarUsageStack.size() && + this->VariableInitialized(name)) + { + this->CheckForUnused("unsetting", name); + this->Internal->VarUsageStack.top().erase(name); + } this->Internal->VarInitStack.top().insert(name); - this->CheckForUnused("unsetting", name); #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* vv = this->GetVariableWatch(); if ( vv ) -- cgit v0.12