| 43 | cmInstallFileSetGenerator::~cmInstallFileSetGenerator() = default; |
| 44 | |
| 45 | bool cmInstallFileSetGenerator::Compute(cmLocalGenerator* lg) |
| 46 | { |
| 47 | this->LocalGenerator = lg; |
| 48 | |
| 49 | // Lookup this target in the current directory. |
| 50 | this->Target = lg->FindLocalNonAliasGeneratorTarget(this->TargetName); |
| 51 | if (!this->Target) { |
| 52 | // If no local target has been found, find it in the global scope. |
| 53 | this->Target = |
| 54 | lg->GetGlobalGenerator()->FindGeneratorTarget(this->TargetName); |
| 55 | } |
| 56 | |
| 57 | auto const& target = *this->Target->Target; |
| 58 | this->FileSet = target.GetFileSet(this->FileSetName); |
| 59 | |
| 60 | if (!this->FileSet) { |
| 61 | // No file set of the given name was ever provided for this target, nothing |
| 62 | // for this generator to do |
| 63 | return true; |
| 64 | } |
| 65 | |
| 66 | cmList interfaceFileSetEntries{ target.GetSafeProperty( |
| 67 | cmTarget::GetInterfaceFileSetsPropertyName(this->FileSet->GetType())) }; |
| 68 | |
| 69 | if (std::find(interfaceFileSetEntries.begin(), interfaceFileSetEntries.end(), |
| 70 | this->FileSetName) != interfaceFileSetEntries.end()) { |
| 71 | if (this->FileSet->GetType() == "HEADERS"_s) { |
| 72 | this->Destination = this->FileSetDestinations.Headers; |
| 73 | } else { |
| 74 | this->Destination = this->FileSetDestinations.CXXModules; |
| 75 | } |
| 76 | } else { |
| 77 | // File set of the given name was provided but it's private, so give up |
| 78 | this->FileSet = nullptr; |
| 79 | return true; |
| 80 | } |
| 81 | |
| 82 | if (this->Destination.empty()) { |
| 83 | lg->IssueMessage(MessageType::FATAL_ERROR, |
| 84 | cmStrCat("File set \"", this->FileSetName, |
| 85 | "\" installed by target \"", this->TargetName, |
| 86 | "\" has no destination.")); |
| 87 | return false; |
| 88 | } |
| 89 | |
| 90 | return true; |
| 91 | } |
| 92 | |
| 93 | std::string cmInstallFileSetGenerator::GetDestination( |
| 94 | std::string const& config) const |
nothing calls this directly
no test coverage detected