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

Method AddImportedTarget

Source/cmMakefile.cxx:3835–3854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3833}
3834
3835cmTarget* cmMakefile::AddImportedTarget(std::string const& name,
3836 cmStateEnums::TargetType type,
3837 bool global)
3838{
3839 // Create the target.
3840 std::unique_ptr<cmTarget> target(
3841 new cmTarget(name, type,
3842 global ? cmTarget::Visibility::ImportedGlobally
3843 : cmTarget::Visibility::Imported,
3844 this, cmTarget::PerConfig::Yes));
3845
3846 // Add to the set of available imported targets.
3847 this->ImportedTargets[name] = target.get();
3848 this->GetGlobalGenerator()->IndexTarget(target.get());
3849 this->GetStateSnapshot().GetDirectory().AddImportedTargetName(name);
3850
3851 // Transfer ownership to this cmMakefile object.
3852 this->ImportedTargetsOwned.push_back(std::move(target));
3853 return this->ImportedTargetsOwned.back().get();
3854}
3855
3856cmTarget* cmMakefile::AddForeignTarget(std::string const& origin,
3857 std::string const& name)

Callers 5

cmAddExecutableCommandFunction · 0.80
cmAddLibraryCommandFunction · 0.80
AddLibraryComponentMethod · 0.80
ImportTargetsMethod · 0.80
HandleImportCommandFunction · 0.80

Calls 9

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

Tested by

no test coverage detected