| 400 | } |
| 401 | |
| 402 | bool HandleReplaceCommand(std::vector<std::string> const& args, |
| 403 | cmExecutionStatus& status) |
| 404 | { |
| 405 | if (args.size() < 5) { |
| 406 | status.SetError("sub-command REPLACE requires at least four arguments."); |
| 407 | return false; |
| 408 | } |
| 409 | |
| 410 | try { |
| 411 | std::string const& matchExpression = args[1]; |
| 412 | std::string const& replaceExpression = args[2]; |
| 413 | std::string const& variableName = args[3]; |
| 414 | cm::CMakeString data{ cmMakeRange(args).advance(4) }; |
| 415 | |
| 416 | data.Replace(matchExpression, replaceExpression); |
| 417 | status.GetMakefile().AddDefinition(variableName, data); |
| 418 | return true; |
| 419 | } catch (std::exception const& e) { |
| 420 | status.SetError(cmStrCat("sub-command REPLACE: ", e.what(), '.')); |
| 421 | return false; |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | bool HandleSubstringCommand(std::vector<std::string> const& args, |
| 426 | cmExecutionStatus& status) |
nothing calls this directly
no test coverage detected
searching dependent graphs…