| 482 | } |
| 483 | |
| 484 | cmFindBase::FindState cmFindBase::GetInitialState() |
| 485 | { |
| 486 | if (cmValue value = this->Makefile->GetDefinition(this->VariableName)) { |
| 487 | cmState* state = this->Makefile->GetState(); |
| 488 | cmValue cacheEntry = state->GetCacheEntryValue(this->VariableName); |
| 489 | bool found = !cmIsNOTFOUND(*value); |
| 490 | bool cached = cacheEntry != nullptr; |
| 491 | auto cacheType = cached ? state->GetCacheEntryType(this->VariableName) |
| 492 | : cmStateEnums::UNINITIALIZED; |
| 493 | |
| 494 | if (cached && cacheType != cmStateEnums::UNINITIALIZED) { |
| 495 | this->VariableType = cacheType; |
| 496 | if (auto const& hs = |
| 497 | state->GetCacheEntryProperty(this->VariableName, "HELPSTRING")) { |
| 498 | this->VariableDocumentation = *hs; |
| 499 | } |
| 500 | } |
| 501 | |
| 502 | if (found) { |
| 503 | // If the user specifies the entry on the command line without a |
| 504 | // type we should add the type and docstring but keep the |
| 505 | // original value. Tell the subclass implementations to do |
| 506 | // this. |
| 507 | if (cached && cacheType == cmStateEnums::UNINITIALIZED) { |
| 508 | this->AlreadyInCacheWithoutMetaInfo = true; |
| 509 | } |
| 510 | return FindState::Found; |
| 511 | } |
| 512 | return FindState::NotFound; |
| 513 | } |
| 514 | return FindState::Undefined; |
| 515 | } |
| 516 | |
| 517 | bool cmFindBase::IsFound() const |
| 518 | { |
no test coverage detected