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

Function checkPropertyConsistency

Source/cmGeneratorTarget_CompatibleInterface.cxx:154–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152
153template <typename PropertyType>
154void checkPropertyConsistency(cmGeneratorTarget const* depender,
155 cmGeneratorTarget const* dependee,
156 std::string const& propName,
157 std::set<std::string>& emitted,
158 std::string const& config, CompatibleType t,
159 PropertyType* /*unused*/)
160{
161 cmValue prop = dependee->GetProperty(propName);
162 if (!prop) {
163 return;
164 }
165
166 cmList props{ *prop };
167 std::string pdir =
168 cmStrCat(cmSystemTools::GetCMakeRoot(), "/Help/prop_tgt/");
169
170 for (std::string const& p : props) {
171 std::string pname = cmSystemTools::HelpFileName(p);
172 std::string pfile = cmStrCat(pdir, pname, ".rst");
173 if (cmSystemTools::FileExists(pfile, true)) {
174 std::ostringstream e;
175 e << "Target \"" << dependee->GetName() << "\" has property \"" << p
176 << "\" listed in its " << propName
177 << " property. "
178 "This is not allowed. Only user-defined properties may appear "
179 "listed in the "
180 << propName << " property.";
181 depender->GetLocalGenerator()->IssueMessage(MessageType::FATAL_ERROR,
182 e.str());
183 return;
184 }
185 if (emitted.insert(p).second) {
186 getLinkInterfaceDependentProperty<PropertyType>(depender, p, config, t,
187 nullptr);
188 if (cmSystemTools::GetErrorOccurredFlag()) {
189 return;
190 }
191 }
192 }
193}
194
195namespace {
196std::string intersect(std::set<std::string> const& s1,

Callers

nothing calls this directly

Calls 8

strMethod · 0.80
cmStrCatFunction · 0.70
FileExistsFunction · 0.50
GetPropertyMethod · 0.45
GetNameMethod · 0.45
IssueMessageMethod · 0.45
GetLocalGeneratorMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…