summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-09 14:22:10 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-09 14:22:10 (GMT)
commit8424d569f0f347c084e919d5c6037ccadb959dab (patch)
tree52ede225888707eceaefa7546b06a09737d23afc /Source
parent12a7e2b10c447e3ed61c2bca69f0264f7fcbdef9 (diff)
parent261c248254faf2fc09d71f456f018b7f8bc9a7f1 (diff)
downloadCMake-8424d569f0f347c084e919d5c6037ccadb959dab.zip
CMake-8424d569f0f347c084e919d5c6037ccadb959dab.tar.gz
CMake-8424d569f0f347c084e919d5c6037ccadb959dab.tar.bz2
Merge topic 'unset-PARENT_SCOPE'
261c248 unset: Add PARENT_SCOPE option
Diffstat (limited to 'Source')
-rw-r--r--Source/cmUnsetCommand.cxx8
-rw-r--r--Source/cmUnsetCommand.h5
2 files changed, 11 insertions, 2 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");
diff --git a/Source/cmUnsetCommand.h b/Source/cmUnsetCommand.h
index 9cf95d9..a477f19 100644
--- a/Source/cmUnsetCommand.h
+++ b/Source/cmUnsetCommand.h
@@ -61,10 +61,13 @@ public:
virtual const char* GetFullDocumentation() const
{
return
- " unset(<variable> [CACHE])\n"
+ " unset(<variable> [CACHE | PARENT_SCOPE])\n"
"Removes the specified variable causing it to become undefined. "
"If CACHE is present then the variable is removed from the cache "
"instead of the current scope.\n"
+ "If PARENT_SCOPE is present then the variable is removed from the "
+ "scope above the current scope. See the same option in the set() "
+ "command for further details.\n"
"<variable> can be an environment variable such as:\n"
" unset(ENV{LD_LIBRARY_PATH})\n"
"in which case the variable will be removed from the current "