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

Method AddSource

Source/cmTarget.cxx:1422–1439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1420};
1421
1422cmSourceFile* cmTarget::AddSource(std::string const& src, bool before)
1423{
1424 cmSourceFileLocation sfl(this->impl->Makefile, src,
1425 cmSourceFileLocationKind::Known);
1426 auto const& sources = this->impl->Sources.Entries;
1427 if (std::find_if(sources.begin(), sources.end(),
1428 TargetPropertyEntryFinder(sfl)) == sources.end()) {
1429 this->impl->Sources.WriteDirect(
1430 this->impl.get(), {}, cmValue(src),
1431 before ? UsageRequirementProperty::Action::Prepend
1432 : UsageRequirementProperty::Action::Append);
1433 }
1434 if (cmGeneratorExpression::Find(src) != std::string::npos) {
1435 return nullptr;
1436 }
1437 return this->impl->Makefile->GetOrCreateSource(
1438 src, false, cmSourceFileLocationKind::Known);
1439}
1440
1441void cmTarget::ClearDependencyInformation(cmMakefile& mf) const
1442{

Callers 11

AddExtraTargetsMethod · 0.45
ForceLinkerLanguageMethod · 0.45
AddPchDependenciesMethod · 0.45
CopyPchCompilePdbMethod · 0.45
AddUnityBuildMethod · 0.45
AddUtilityCommandFunction · 0.45
AddCheckTargetMethod · 0.45
AddGeneratedSourceMethod · 0.45
AddCheckTargetMethod · 0.45
FixGlobalTargetsMethod · 0.45
AddXCConfigSourcesMethod · 0.45

Calls 7

WriteDirectMethod · 0.80
GetOrCreateSourceMethod · 0.80
cmValueClass · 0.70
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected