set: Fix handling of empty value with PARENT_SCOPE

Just as

  set(VAR "")

sets VAR to an empty string in the current scope, the code

  set(VAR "" PARENT_SCOPE)

is documented to set the variable to an empty string in the parent
scope.  Fix the implementation to make it so.
This commit is contained in:
Daniele E. Domenichelli 2013-11-13 09:02:56 +01:00 committed by Brad King
parent 20afbd5e03
commit bc280f1c81
1 changed files with 2 additions and 9 deletions

View File

@ -122,15 +122,8 @@ bool cmSetCommand
if (parentScope) if (parentScope)
{ {
if (value.empty()) this->Makefile->RaiseScope(variable, value.c_str());
{ return true;
this->Makefile->RaiseScope(variable, 0);
}
else
{
this->Makefile->RaiseScope(variable, value.c_str());
}
return true;
} }