summaryrefslogtreecommitdiffstats
path: root/Source/cmSetCommand.cxx
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <daniele.domenichelli@iit.it>2013-11-13 07:59:26 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-13 15:14:21 (GMT)
commit20afbd5e037a0ccfa55af8564ed8cd3ec2430540 (patch)
treef1cab7cc50e5e1dc6f9988f191701ec1e131e381 /Source/cmSetCommand.cxx
parent706aab0418f40e9816be5270e5b4e89321411e2d (diff)
downloadCMake-20afbd5e037a0ccfa55af8564ed8cd3ec2430540.zip
CMake-20afbd5e037a0ccfa55af8564ed8cd3ec2430540.tar.gz
CMake-20afbd5e037a0ccfa55af8564ed8cd3ec2430540.tar.bz2
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.
Diffstat (limited to 'Source/cmSetCommand.cxx')
-rw-r--r--Source/cmSetCommand.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 20f38be..22b4383 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -62,9 +62,17 @@ bool cmSetCommand
this->Makefile->RemoveDefinition(args[0].c_str());
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
// SET (VAR value )
+ // SET (VAR value PARENT_SCOPE)
// SET (VAR CACHE TYPE "doc String" [FORCE])
// SET (VAR value CACHE TYPE "doc string" [FORCE])
std::string value; // optional