| 3833 | } |
| 3834 | |
| 3835 | cmTarget* 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 | |
| 3856 | cmTarget* cmMakefile::AddForeignTarget(std::string const& origin, |
| 3857 | std::string const& name) |
no test coverage detected