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

Method GetSourceFileWithOutput

Source/cmLocalGenerator.cxx:5243–5263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5241}
5242
5243cmSourceFile* cmLocalGenerator::GetSourceFileWithOutput(
5244 std::string const& name, cmSourceOutputKind kind) const
5245{
5246 // If the queried path is not absolute we use the backward compatible
5247 // linear-time search for an output with a matching suffix.
5248 if (!cmSystemTools::FileIsFullPath(name)) {
5249 bool byproduct = false;
5250 return this->LinearGetSourceFileWithOutput(name, kind, byproduct);
5251 }
5252 // Otherwise we use an efficient lookup map.
5253 auto o = this->OutputToSource.find(name);
5254 if (o != this->OutputToSource.end() &&
5255 (!o->second.Sources.SourceIsByproduct ||
5256 kind == cmSourceOutputKind::OutputOrByproduct)) {
5257 // Source file could also be null pointer for example if we found the
5258 // byproduct of a utility target, a PRE_BUILD, PRE_LINK, or POST_BUILD
5259 // command of a target, or a not yet created custom command.
5260 return o->second.Sources.Source;
5261 }
5262 return nullptr;
5263}
5264
5265std::string cmLocalGenerator::CreateUtilityOutput(
5266 std::string const& targetName, std::vector<std::string> const&,

Callers 2

VisitCustomCommandMethod · 0.80

Calls 3

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected