| 2075 | } |
| 2076 | |
| 2077 | bool cmFindPackageCommand::ReadListFile(std::string const& f, |
| 2078 | PolicyScopeRule const psr) |
| 2079 | { |
| 2080 | bool const noPolicyScope = !this->PolicyScope || psr == NoPolicyScope; |
| 2081 | |
| 2082 | using ITScope = cmMakefile::ImportedTargetScope; |
| 2083 | ITScope scope = this->GlobalScope ? ITScope::Global : ITScope::Local; |
| 2084 | cmMakefile::SetGlobalTargetImportScope globScope(this->Makefile, scope); |
| 2085 | |
| 2086 | auto oldUnwind = this->Makefile->GetStateSnapshot().GetUnwindType(); |
| 2087 | |
| 2088 | // This allows child snapshots to inherit the CAN_UNWIND state from us, we'll |
| 2089 | // reset it immediately after the dependent file is done |
| 2090 | this->Makefile->GetStateSnapshot().SetUnwindType(cmStateEnums::CAN_UNWIND); |
| 2091 | bool result = this->Makefile->ReadDependentFile(f, noPolicyScope); |
| 2092 | |
| 2093 | this->Makefile->GetStateSnapshot().SetUnwindType(oldUnwind); |
| 2094 | this->Makefile->GetStateSnapshot().SetUnwindState( |
| 2095 | cmStateEnums::NOT_UNWINDING); |
| 2096 | |
| 2097 | if (!result) { |
| 2098 | std::string const e = |
| 2099 | cmStrCat("Error reading CMake code from \"", f, "\"."); |
| 2100 | this->SetError(e); |
| 2101 | } |
| 2102 | |
| 2103 | return result; |
| 2104 | } |
| 2105 | |
| 2106 | bool cmFindPackageCommand::ReadPackage() |
| 2107 | { |
no test coverage detected