summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-11-13 15:29:21 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-11-13 15:29:36 (GMT)
commit71e77972c18e1ab905b36782d7b2c2f838957e26 (patch)
tree3d0f0423191787f1c2db088c504441909f54f2c9 /Source
parent5e12fad8704e4797ecda3906f3b558775b70539f (diff)
parent1222f02e343e804f1fcc8ff09e56dc13ac233d98 (diff)
downloadCMake-71e77972c18e1ab905b36782d7b2c2f838957e26.zip
CMake-71e77972c18e1ab905b36782d7b2c2f838957e26.tar.gz
CMake-71e77972c18e1ab905b36782d7b2c2f838957e26.tar.bz2
Merge topic 'if_support_checking_if_cache_var_defined'
1222f02e34 If: Support the 'DEFINED CACHE{}' syntax Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2561
Diffstat (limited to 'Source')
-rw-r--r--Source/cmConditionEvaluator.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index 172ef92..3b4206f 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -495,6 +495,12 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
argP1->GetValue().operator[](argP1len - 1) == '}') {
std::string env = argP1->GetValue().substr(4, argP1len - 5);
bdef = cmSystemTools::HasEnv(env);
+ } else if (argP1len > 6 &&
+ argP1->GetValue().substr(0, 6) == "CACHE{" &&
+ argP1->GetValue().operator[](argP1len - 1) == '}') {
+ std::string cache = argP1->GetValue().substr(6, argP1len - 7);
+ bdef =
+ this->Makefile.GetState()->GetCacheEntryValue(cache) != nullptr;
} else {
bdef = this->Makefile.IsDefinitionSet(argP1->GetValue());
}