Przeglądaj źródła

set: Handle value-less PARENT_SCOPE explicitly

The code "set(VAR PARENT_SCOPE)" unsets VAR in the parent scope.
Implement this case explicitly next to where "set(VAR)" is explicitly
handled to unset VAR in the current scope.
Daniele E. Domenichelli 12 lat temu
rodzic
commit
20afbd5e03
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      Source/cmSetCommand.cxx

+ 8 - 0
Source/cmSetCommand.cxx

@@ -62,9 +62,17 @@ bool cmSetCommand
     this->Makefile->RemoveDefinition(args[0].c_str());
     this->Makefile->RemoveDefinition(args[0].c_str());
     return true;
     return true;
     }
     }
+  // SET (VAR PARENT_SCOPE) // Removes the definition of VAR
+                            // in the parent scope.
+  else if (args.size() == 2 && args[args.size()-1] == "PARENT_SCOPE")
+    {
+    this->Makefile->RaiseScope(variable, 0);
+    return true;
+    }
 
 
   // here are the remaining options
   // here are the remaining options
   //  SET (VAR value )
   //  SET (VAR value )
+  //  SET (VAR value PARENT_SCOPE)
   //  SET (VAR CACHE TYPE "doc String" [FORCE])
   //  SET (VAR CACHE TYPE "doc String" [FORCE])
   //  SET (VAR value CACHE TYPE "doc string" [FORCE])
   //  SET (VAR value CACHE TYPE "doc string" [FORCE])
   std::string value;  // optional
   std::string value;  // optional