summaryrefslogtreecommitdiffstats
path: root/Source/cmConditionEvaluator.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2018-11-02 21:27:09 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2018-11-09 15:38:07 (GMT)
commit1222f02e343e804f1fcc8ff09e56dc13ac233d98 (patch)
tree9e2a433430c3fd32b98ddf4d4f554eb69a103930 /Source/cmConditionEvaluator.cxx
parent9463d73cc4d58b190fac0cac6aeee424b5d29514 (diff)
downloadCMake-1222f02e343e804f1fcc8ff09e56dc13ac233d98.zip
CMake-1222f02e343e804f1fcc8ff09e56dc13ac233d98.tar.gz
CMake-1222f02e343e804f1fcc8ff09e56dc13ac233d98.tar.bz2
If: Support the 'DEFINED CACHE{}' syntax
Diffstat (limited to 'Source/cmConditionEvaluator.cxx')
-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());
}