MCPcopy Create free account
hub / github.com/Kitware/CMake / CheckGenExParameters

Function CheckGenExParameters

Source/cmGeneratorExpressionNode.cxx:754–786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

752using Arguments = Range<std::vector<std::string>>;
753
754bool CheckGenExParameters(cm::GenEx::Evaluation* eval,
755 GeneratorExpressionContent const* cnt,
756 cm::string_view genex, cm::string_view option,
757 std::size_t count, int required = 1,
758 bool exactly = true)
759{
760 if (static_cast<int>(count) < required ||
761 (exactly && static_cast<int>(count) > required)) {
762 std::string nbParameters;
763 switch (required) {
764 case 1:
765 nbParameters = "one parameter";
766 break;
767 case 2:
768 nbParameters = "two parameters";
769 break;
770 case 3:
771 nbParameters = "three parameters";
772 break;
773 case 4:
774 nbParameters = "four parameters";
775 break;
776 default:
777 nbParameters = cmStrCat(required, " parameters");
778 }
779 reportError(eval, cnt->GetOriginalExpression(),
780 cmStrCat("$<", genex, ':', option, "> expression requires ",
781 (exactly ? "exactly" : "at least"), ' ', nbParameters,
782 '.'));
783 return false;
784 }
785 return true;
786};
787
788template <typename IndexType>
789bool GetNumericArgument(std::string const& arg, IndexType& value)

Callers 3

CheckPathParametersExFunction · 0.85
CheckStringParametersExFunction · 0.85
CheckListParametersExFunction · 0.85

Calls 3

reportErrorFunction · 0.85
GetOriginalExpressionMethod · 0.80
cmStrCatFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…