Browse Source

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.
Daniele E. Domenichelli 12 years ago
parent
commit
bc280f1c81
1 changed files with 2 additions and 9 deletions
  1. 2 9
      Source/cmSetCommand.cxx

+ 2 - 9
Source/cmSetCommand.cxx

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