| 1106 | } |
| 1107 | |
| 1108 | void cmVisualStudio10TargetGenerator::WriteDotNetReferences(Elem& e0) |
| 1109 | { |
| 1110 | cmList references; |
| 1111 | if (cmValue vsDotNetReferences = |
| 1112 | this->GeneratorTarget->GetProperty("VS_DOTNET_REFERENCES")) { |
| 1113 | references.assign(*vsDotNetReferences); |
| 1114 | } |
| 1115 | cmPropertyMap const& props = this->GeneratorTarget->Target->GetProperties(); |
| 1116 | for (auto const& i : props.GetList()) { |
| 1117 | static cm::string_view const vsDnRef = "VS_DOTNET_REFERENCE_"; |
| 1118 | if (cmHasPrefix(i.first, vsDnRef)) { |
| 1119 | std::string path = i.second; |
| 1120 | if (!cmsys::SystemTools::FileIsFullPath(path)) { |
| 1121 | path = |
| 1122 | cmStrCat(this->Makefile->GetCurrentSourceDirectory(), '/', path); |
| 1123 | } |
| 1124 | ConvertToWindowsSlash(path); |
| 1125 | this->DotNetHintReferences[""].emplace_back( |
| 1126 | DotNetHintReference(i.first.substr(vsDnRef.length()), path)); |
| 1127 | } |
| 1128 | } |
| 1129 | if (!references.empty() || !this->DotNetHintReferences.empty()) { |
| 1130 | Elem e1(e0, "ItemGroup"); |
| 1131 | for (auto const& ri : references) { |
| 1132 | // if the entry from VS_DOTNET_REFERENCES is an existing file, generate |
| 1133 | // a new hint-reference and name it from the filename |
| 1134 | if (cmsys::SystemTools::FileExists(ri, true)) { |
| 1135 | std::string name = |
| 1136 | cmsys::SystemTools::GetFilenameWithoutLastExtension(ri); |
| 1137 | std::string path = ri; |
| 1138 | ConvertToWindowsSlash(path); |
| 1139 | this->DotNetHintReferences[""].emplace_back( |
| 1140 | DotNetHintReference(name, path)); |
| 1141 | } else { |
| 1142 | this->WriteDotNetReference(e1, ri, "", ""); |
| 1143 | } |
| 1144 | } |
| 1145 | for (auto const& h : this->DotNetHintReferences) { |
| 1146 | // DotNetHintReferences is also populated from AddLibraries(). |
| 1147 | // The configuration specific hint references are added there. |
| 1148 | for (auto const& i : h.second) { |
| 1149 | this->WriteDotNetReference(e1, i.first, i.second, h.first); |
| 1150 | } |
| 1151 | } |
| 1152 | } |
| 1153 | } |
| 1154 | |
| 1155 | void cmVisualStudio10TargetGenerator::WriteDotNetReference( |
| 1156 | Elem& e1, std::string const& ref, std::string const& hint, |
no test coverage detected