| 299 | |
| 300 | namespace GetPropertyCommand { |
| 301 | bool 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 | |
| 332 | namespace { |
no test coverage detected
searching dependent graphs…