summaryrefslogtreecommitdiffstats
path: root/Source/cmCommandArgumentParserHelper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCommandArgumentParserHelper.cxx')
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index 2aa6c0c..c67f884 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -87,9 +87,24 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
}
return this->EmptyVariable;
}
+ if ( strcmp(key, "CACHE") == 0 )
+ {
+ if(const char* c = this->Makefile->GetCacheManager()->GetCacheValue(var))
+ {
+ if(this->EscapeQuotes)
+ {
+ return this->AddString(cmSystemTools::EscapeQuotes(c).c_str());
+ }
+ else
+ {
+ return this->AddString(c);
+ }
+ }
+ return this->EmptyVariable;
+ }
cmOStringStream e;
e << "Syntax $" << key << "{} is not supported. "
- << "Only ${} and ENV{} are allowed.";
+ << "Only ${}, $ENV{}, and $CACHE{} are allowed.";
this->SetError(e.str());
return 0;
}