| 371 | } |
| 372 | |
| 373 | bool HandleDirectoryMode(cmExecutionStatus& status, std::string const& name, |
| 374 | OutType infoType, std::string const& variable, |
| 375 | std::string const& propertyName) |
| 376 | { |
| 377 | // Default to the current directory. |
| 378 | cmMakefile* mf = &status.GetMakefile(); |
| 379 | |
| 380 | // Lookup the directory if given. |
| 381 | if (!name.empty()) { |
| 382 | // Construct the directory name. Interpret relative paths with |
| 383 | // respect to the current directory. |
| 384 | std::string dir = cmSystemTools::CollapseFullPath( |
| 385 | name, status.GetMakefile().GetCurrentSourceDirectory()); |
| 386 | |
| 387 | // Lookup the generator. |
| 388 | mf = status.GetMakefile().GetGlobalGenerator()->FindMakefile(dir); |
| 389 | if (!mf) { |
| 390 | // Could not find the directory. |
| 391 | status.SetError( |
| 392 | "DIRECTORY scope provided but requested directory was not found. " |
| 393 | "This could be because the directory argument was invalid or, " |
| 394 | "it is valid but has not been processed yet."); |
| 395 | return false; |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | // Get the property. |
| 400 | return StoreResult(infoType, status.GetMakefile(), variable, |
| 401 | mf->GetProperty(propertyName)); |
| 402 | } |
| 403 | |
| 404 | bool HandleTargetMode(cmExecutionStatus& status, std::string const& name, |
| 405 | OutType infoType, std::string const& variable, |
no test coverage detected
searching dependent graphs…