diff options
author | Brad King <brad.king@kitware.com> | 2013-10-09 14:22:10 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-10-09 14:22:10 (GMT) |
commit | 8424d569f0f347c084e919d5c6037ccadb959dab (patch) | |
tree | 52ede225888707eceaefa7546b06a09737d23afc /Source | |
parent | 12a7e2b10c447e3ed61c2bca69f0264f7fcbdef9 (diff) | |
parent | 261c248254faf2fc09d71f456f018b7f8bc9a7f1 (diff) | |
download | CMake-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.cxx | 8 | ||||
-rw-r--r-- | Source/cmUnsetCommand.h | 5 |
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 " |