| 294 | } |
| 295 | |
| 296 | bool HandleFindCommand(std::vector<std::string> const& args, |
| 297 | cmExecutionStatus& status) |
| 298 | { |
| 299 | if (args.size() != 4) { |
| 300 | status.SetError("sub-command FIND requires three arguments."); |
| 301 | return false; |
| 302 | } |
| 303 | |
| 304 | std::string const& listName = args[1]; |
| 305 | std::string const& variableName = args.back(); |
| 306 | // expand the variable |
| 307 | auto list = GetList(listName, status.GetMakefile()); |
| 308 | |
| 309 | if (!list) { |
| 310 | status.GetMakefile().AddDefinition(variableName, "-1"); |
| 311 | return true; |
| 312 | } |
| 313 | |
| 314 | auto index = list->find(args[2]); |
| 315 | status.GetMakefile().AddDefinition( |
| 316 | variableName, index == cmList::npos ? "-1" : std::to_string(index)); |
| 317 | return true; |
| 318 | } |
| 319 | |
| 320 | bool HandleInsertCommand(std::vector<std::string> const& args, |
| 321 | cmExecutionStatus& status) |
nothing calls this directly
no test coverage detected
searching dependent graphs…