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

Function GetSourceFilePropertyGENERATED

Source/cmGetPropertyCommand.cxx:301–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299
300namespace GetPropertyCommand {
301bool GetSourceFilePropertyGENERATED(
302 std::string const& name, cmMakefile& mf,
303 std::function<bool(bool)> const& storeResult)
304{
305 // Globally set as generated?
306 // Note: If the given "name" only contains a filename or a relative path
307 // the file's location is ambiguous. In general, one would expect
308 // it in the source-directory, because that is where source files
309 // are located normally. However, generated files are normally
310 // generated in the build-directory. Therefore, we first check for
311 // a generated file in the build-directory before we check for a
312 // generated file in the source-directory.
313 {
314 auto file =
315 cmSystemTools::CollapseFullPath(name, mf.GetCurrentBinaryDirectory());
316 if (mf.GetGlobalGenerator()->IsGeneratedFile(file)) {
317 return storeResult(true);
318 }
319 }
320 {
321 auto file =
322 cmSystemTools::CollapseFullPath(name, mf.GetCurrentSourceDirectory());
323 if (mf.GetGlobalGenerator()->IsGeneratedFile(file)) {
324 return storeResult(true);
325 }
326 }
327 // Skip checking the traditional/local property.
328 return storeResult(false);
329}
330}
331
332namespace {

Callers 2

HandleSourceModeFunction · 0.85

Calls 2

IsGeneratedFileMethod · 0.80
GetGlobalGeneratorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…