| 557 | } |
| 558 | |
| 559 | bool HandleInstallMode(cmExecutionStatus& status, std::string const& name, |
| 560 | OutType infoType, std::string const& variable, |
| 561 | std::string const& propertyName) |
| 562 | { |
| 563 | if (name.empty()) { |
| 564 | status.SetError("not given name for INSTALL scope."); |
| 565 | return false; |
| 566 | } |
| 567 | |
| 568 | // Get the installed file. |
| 569 | cmake* cm = status.GetMakefile().GetCMakeInstance(); |
| 570 | |
| 571 | if (cmInstalledFile* file = |
| 572 | cm->GetOrCreateInstalledFile(&status.GetMakefile(), name)) { |
| 573 | std::string value; |
| 574 | bool isSet = file->GetProperty(propertyName, value); |
| 575 | |
| 576 | return StoreResult(infoType, status.GetMakefile(), variable, |
| 577 | isSet ? value.c_str() : nullptr); |
| 578 | } |
| 579 | status.SetError( |
| 580 | cmStrCat("given INSTALL name that could not be found or created: ", name)); |
| 581 | return false; |
| 582 | } |
| 583 | } |
no test coverage detected
searching dependent graphs…