MCPcopy Create free account
hub / github.com/Kitware/CMake / Compute

Method Compute

Source/cmInstallFileSetGenerator.cxx:45–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43cmInstallFileSetGenerator::~cmInstallFileSetGenerator() = default;
44
45bool 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
93std::string cmInstallFileSetGenerator::GetDestination(
94 std::string const& config) const

Callers

nothing calls this directly

Calls 11

FindGeneratorTargetMethod · 0.80
cmStrCatFunction · 0.70
findFunction · 0.50
GetGlobalGeneratorMethod · 0.45
GetFileSetMethod · 0.45
GetTypeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
IssueMessageMethod · 0.45

Tested by

no test coverage detected