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

Method AddForeignTarget

Source/cmMakefile.cxx:3856–3870  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3854}
3855
3856cmTarget* cmMakefile::AddForeignTarget(std::string const& origin,
3857 std::string const& name)
3858{
3859 auto foreign_name = cmStrCat("@foreign_", origin, "::", name);
3860 std::unique_ptr<cmTarget> target(new cmTarget(
3861 foreign_name, cmStateEnums::TargetType::INTERFACE_LIBRARY,
3862 cmTarget::Visibility::Foreign, this, cmTarget::PerConfig::Yes));
3863
3864 this->ImportedTargets[foreign_name] = target.get();
3865 this->GetGlobalGenerator()->IndexTarget(target.get());
3866 this->GetStateSnapshot().GetDirectory().AddImportedTargetName(foreign_name);
3867
3868 this->ImportedTargetsOwned.push_back(std::move(target));
3869 return this->ImportedTargetsOwned.back().get();
3870}
3871
3872cmTarget* cmMakefile::FindTargetToUse(
3873 std::string const& name, cmStateEnums::TargetDomainSet domains) const

Callers 1

CreateCMakeTargetFunction · 0.80

Calls 10

GetGlobalGeneratorMethod · 0.95
GetStateSnapshotMethod · 0.95
moveFunction · 0.85
IndexTargetMethod · 0.80
AddImportedTargetNameMethod · 0.80
push_backMethod · 0.80
cmStrCatFunction · 0.70
getMethod · 0.45
GetDirectoryMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected