| 402 | } |
| 403 | |
| 404 | bool HandleTargetMode(cmExecutionStatus& status, std::string const& name, |
| 405 | OutType infoType, std::string const& variable, |
| 406 | std::string const& propertyName) |
| 407 | { |
| 408 | if (name.empty()) { |
| 409 | status.SetError("not given name for TARGET scope."); |
| 410 | return false; |
| 411 | } |
| 412 | |
| 413 | if (cmTarget* target = status.GetMakefile().FindTargetToUse(name)) { |
| 414 | if (propertyName == "ALIASED_TARGET" || propertyName == "ALIAS_GLOBAL") { |
| 415 | if (status.GetMakefile().IsAlias(name)) { |
| 416 | if (propertyName == "ALIASED_TARGET") { |
| 417 | |
| 418 | return StoreResult(infoType, status.GetMakefile(), variable, |
| 419 | target->GetName().c_str()); |
| 420 | } |
| 421 | if (propertyName == "ALIAS_GLOBAL") { |
| 422 | return StoreResult( |
| 423 | infoType, status.GetMakefile(), variable, |
| 424 | status.GetMakefile().GetGlobalGenerator()->IsAlias(name) |
| 425 | ? "TRUE" |
| 426 | : "FALSE"); |
| 427 | } |
| 428 | } |
| 429 | return StoreResult(infoType, status.GetMakefile(), variable, nullptr); |
| 430 | } |
| 431 | cmValue prop = |
| 432 | target->GetComputedProperty(propertyName, status.GetMakefile()); |
| 433 | if (!prop) { |
| 434 | prop = target->GetProperty(propertyName); |
| 435 | } |
| 436 | return StoreResult(infoType, status.GetMakefile(), variable, prop); |
| 437 | } |
| 438 | status.SetError(cmStrCat("could not find TARGET ", name, |
| 439 | ". Perhaps it has not yet been created.")); |
| 440 | return false; |
| 441 | } |
| 442 | |
| 443 | bool HandleFileSetMode(cmExecutionStatus& status, std::string const& name, |
| 444 | OutType infoType, std::string const& variable, |
no test coverage detected
searching dependent graphs…