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

Method EvaluateFileEntry

Source/cmFileSet.cxx:219–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219void cmFileSet::EvaluateFileEntry(
220 std::vector<std::string> const& dirs,
221 std::map<std::string, std::vector<std::string>>& filesPerDir,
222 std::unique_ptr<cmCompiledGeneratorExpression> const& cge,
223 cm::GenEx::Context const& context, cmGeneratorTarget const* target,
224 cmGeneratorExpressionDAGChecker* dagChecker) const
225{
226 auto files = cge->Evaluate(context, dagChecker, target);
227 for (std::string file : cmList{ files }) {
228 if (!cmSystemTools::FileIsFullPath(file)) {
229 file = cmStrCat(context.LG->GetCurrentSourceDirectory(), '/', file);
230 }
231 auto collapsedFile = cmSystemTools::CollapseFullPath(file);
232 bool found = false;
233 std::string relDir;
234 for (auto const& dir : dirs) {
235 auto collapsedDir = cmSystemTools::CollapseFullPath(dir);
236 if (cmSystemTools::IsSubDirectory(collapsedFile, collapsedDir)) {
237 found = true;
238 relDir = cmSystemTools::GetParentDirectory(
239 cmSystemTools::RelativePath(collapsedDir, collapsedFile));
240 break;
241 }
242 }
243 if (!found) {
244 std::ostringstream e;
245 e << "File:\n " << file
246 << "\nmust be in one of the file set's base directories:";
247 for (auto const& dir : dirs) {
248 e << "\n " << dir;
249 }
250 context.LG->GetCMakeInstance()->IssueMessage(
251 MessageType::FATAL_ERROR, e.str(), cge->GetBacktrace());
252 return;
253 }
254
255 filesPerDir[relDir].push_back(file);
256 }
257}
258
259bool cmFileSet::IsValidName(std::string const& name)
260{

Callers 10

WriteTargetBuildRulesMethod · 0.80
GetFileSetFilesMethod · 0.80
BuildFileSetInfoCacheMethod · 0.80
CalculateFilesPerDirMethod · 0.80
DumpInstallerMethod · 0.80
DumpFileSetsMethod · 0.80
GetFileSetFilesMethod · 0.80

Calls 7

strMethod · 0.80
push_backMethod · 0.80
cmStrCatFunction · 0.70
EvaluateMethod · 0.45
IssueMessageMethod · 0.45
GetCMakeInstanceMethod · 0.45
GetBacktraceMethod · 0.45

Tested by

no test coverage detected