|
@@ -93,6 +93,16 @@ auto const InListConditionHelper =
|
|
|
.Bind("list"_s, &cmCMakePresetsFileInternal::InListCondition::List,
|
|
.Bind("list"_s, &cmCMakePresetsFileInternal::InListCondition::List,
|
|
|
ConditionStringListHelper, true);
|
|
ConditionStringListHelper, true);
|
|
|
|
|
|
|
|
|
|
+auto const MatchesConditionHelper =
|
|
|
|
|
+ cmJSONObjectHelper<cmCMakePresetsFileInternal::MatchesCondition,
|
|
|
|
|
+ ReadFileResult>(ReadFileResult::READ_OK,
|
|
|
|
|
+ ReadFileResult::INVALID_CONDITION, false)
|
|
|
|
|
+ .Bind<std::string>("type"_s, nullptr, ConditionStringHelper, true)
|
|
|
|
|
+ .Bind("string"_s, &cmCMakePresetsFileInternal::MatchesCondition::String,
|
|
|
|
|
+ ConditionStringHelper, true)
|
|
|
|
|
+ .Bind("regex"_s, &cmCMakePresetsFileInternal::MatchesCondition::Regex,
|
|
|
|
|
+ ConditionStringHelper, true);
|
|
|
|
|
+
|
|
|
ReadFileResult SubConditionHelper(
|
|
ReadFileResult SubConditionHelper(
|
|
|
std::unique_ptr<cmCMakePresetsFile::Condition>& out,
|
|
std::unique_ptr<cmCMakePresetsFile::Condition>& out,
|
|
|
const Json::Value* value);
|
|
const Json::Value* value);
|
|
@@ -177,6 +187,16 @@ ReadFileResult ConditionHelper(
|
|
|
return ReadFileResult::READ_OK;
|
|
return ReadFileResult::READ_OK;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (type == "matches" || type == "notMatches") {
|
|
|
|
|
+ auto c = cm::make_unique<cmCMakePresetsFileInternal::MatchesCondition>();
|
|
|
|
|
+ CHECK_OK(MatchesConditionHelper(*c, value));
|
|
|
|
|
+ out = std::move(c);
|
|
|
|
|
+ if (type == "notMatches") {
|
|
|
|
|
+ out = InvertCondition(std::move(out));
|
|
|
|
|
+ }
|
|
|
|
|
+ return ReadFileResult::READ_OK;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (type == "anyOf" || type == "allOf") {
|
|
if (type == "anyOf" || type == "allOf") {
|
|
|
auto c =
|
|
auto c =
|
|
|
cm::make_unique<cmCMakePresetsFileInternal::AnyAllOfCondition>();
|
|
cm::make_unique<cmCMakePresetsFileInternal::AnyAllOfCondition>();
|