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

Function checkSingleParameterArgumentPreconditions

Source/cmSourceGroupCommand.cxx:303–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303static bool checkSingleParameterArgumentPreconditions(
304 std::string const& argument, ParsedArguments const& parsedArguments,
305 std::string& errorMsg)
306{
307 auto foundArgument = parsedArguments.find(argument);
308 if (foundArgument != parsedArguments.end()) {
309 std::vector<std::string> const& optionArguments = foundArgument->second;
310
311 if (optionArguments.empty()) {
312 errorMsg = argument + " argument given without an argument.";
313 return false;
314 }
315 if (optionArguments.size() > 1) {
316 errorMsg = "too many arguments passed to " + argument + ".";
317 return false;
318 }
319 }
320
321 return true;
322}

Callers 1

Calls 4

findMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…