summaryrefslogtreecommitdiffstats
path: root/Source/cmUnsetCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-08 12:37:47 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-08 12:37:50 (GMT)
commit261c248254faf2fc09d71f456f018b7f8bc9a7f1 (patch)
treea23655839e6c669b682f6fff74d78a8a17dfc821 /Source/cmUnsetCommand.cxx
parent1d9af198a8ea4e9329839c2e1f101106d8bdf505 (diff)
downloadCMake-261c248254faf2fc09d71f456f018b7f8bc9a7f1.zip
CMake-261c248254faf2fc09d71f456f018b7f8bc9a7f1.tar.gz
CMake-261c248254faf2fc09d71f456f018b7f8bc9a7f1.tar.bz2
unset: Add PARENT_SCOPE option
Add an unset() command option to remove a variable from the calling scope, just like the set() command's PARENT_SCOPE option. Teach the Unset test to cover such cases.
Diffstat (limited to 'Source/cmUnsetCommand.cxx')
-rw-r--r--Source/cmUnsetCommand.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmUnsetCommand.cxx b/Source/cmUnsetCommand.cxx
index 5c0cfaa..84f3029 100644
--- a/Source/cmUnsetCommand.cxx
+++ b/Source/cmUnsetCommand.cxx
@@ -49,7 +49,13 @@ bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
this->Makefile->RemoveCacheDefinition(variable);
return true;
}
- // ERROR: second argument isn't CACHE
+ // unset(VAR PARENT_SCOPE)
+ else if ((args.size() == 2) && (args[1] == "PARENT_SCOPE"))
+ {
+ this->Makefile->RaiseScope(variable, 0);
+ return true;
+ }
+ // ERROR: second argument isn't CACHE or PARENT_SCOPE
else
{
this->SetError("called with an invalid second argument");