MCPcopy Create free account
hub / github.com/Kitware/CMake / ReadListFile

Method ReadListFile

Source/cmFindPackageCommand.cxx:2077–2104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2075}
2076
2077bool 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
2106bool cmFindPackageCommand::ReadPackage()
2107{

Callers 3

FindModuleMethod · 0.95
HandlePackageModeMethod · 0.95
CheckVersionFileMethod · 0.95

Calls 7

GetUnwindTypeMethod · 0.80
SetUnwindTypeMethod · 0.80
ReadDependentFileMethod · 0.80
SetUnwindStateMethod · 0.80
cmStrCatFunction · 0.70
GetStateSnapshotMethod · 0.45
SetErrorMethod · 0.45

Tested by

no test coverage detected