| 331 | } |
| 332 | |
| 333 | bool HandleReplaceFilenameCommand(std::vector<std::string> const& args, |
| 334 | cmExecutionStatus& status) |
| 335 | { |
| 336 | static OutputVariableParser const parser{}; |
| 337 | |
| 338 | auto const arguments = parser.Parse(args); |
| 339 | |
| 340 | if (arguments.MaybeReportError(status.GetMakefile())) { |
| 341 | return true; |
| 342 | } |
| 343 | |
| 344 | if (parser.GetInputs().size() > 1) { |
| 345 | status.SetError("REPLACE_FILENAME called with unexpected arguments."); |
| 346 | return false; |
| 347 | } |
| 348 | |
| 349 | std::string inputPath; |
| 350 | if (!getInputPath(args[1], status, inputPath)) { |
| 351 | return false; |
| 352 | } |
| 353 | |
| 354 | cmCMakePath path(inputPath); |
| 355 | path.ReplaceFileName( |
| 356 | parser.GetInputs().empty() ? "" : parser.GetInputs().front()); |
| 357 | |
| 358 | status.GetMakefile().AddDefinition( |
| 359 | arguments.Output ? *arguments.Output : args[1], path.String()); |
| 360 | |
| 361 | return true; |
| 362 | } |
| 363 | |
| 364 | bool HandleRemoveExtensionCommand(std::vector<std::string> const& args, |
| 365 | cmExecutionStatus& status) |
nothing calls this directly
no test coverage detected
searching dependent graphs…