diff options
author | Brad King <brad.king@kitware.com> | 2013-11-14 16:28:12 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-11-14 16:28:12 (GMT) |
commit | 15872a3c3038368784e43074ea0b9539b3e03bfb (patch) | |
tree | 0f18bc3547704cf1b6340e092be0d403da8f51f1 /Source | |
parent | 42eaf3416890ca6fc4462c112492bb740e943525 (diff) | |
parent | bf755c7c381d8d7d84578bf2dc4ac673aefa090a (diff) | |
download | CMake-15872a3c3038368784e43074ea0b9539b3e03bfb.zip CMake-15872a3c3038368784e43074ea0b9539b3e03bfb.tar.gz CMake-15872a3c3038368784e43074ea0b9539b3e03bfb.tar.bz2 |
Merge topic 'set_emptyvar_PARENT_SCOPE'
bf755c7 set: Add unit tests for set/unset PARENT_SCOPE
bc280f1 set: Fix handling of empty value with PARENT_SCOPE
20afbd5 set: Handle value-less PARENT_SCOPE explicitly
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmSetCommand.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 20f38be..bb193bf 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 @@ -114,15 +122,8 @@ bool cmSetCommand if (parentScope) { - if (value.empty()) - { - this->Makefile->RaiseScope(variable, 0); - } - else - { - this->Makefile->RaiseScope(variable, value.c_str()); - } - return true; + this->Makefile->RaiseScope(variable, value.c_str()); + return true; } |