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

Method Validate

Source/cmFindBase.cxx:251–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251bool cmFindBase::Validate(std::string const& path) const
252{
253 if (this->ValidatorName.empty()) {
254 return true;
255 }
256
257 // The validator command will be executed in an isolated scope.
258 cmMakefile::ScopePushPop varScope(this->Makefile);
259 cmMakefile::PolicyPushPop polScope(this->Makefile);
260 static_cast<void>(varScope);
261 static_cast<void>(polScope);
262
263 auto resultName =
264 cmStrCat("CMAKE_"_s, cmSystemTools::UpperCase(this->FindCommandName),
265 "_VALIDATOR_STATUS"_s);
266
267 this->Makefile->AddDefinitionBool(resultName, true);
268
269 cmListFileFunction validator(
270 this->ValidatorName, 0, 0,
271 { cmListFileArgument(resultName, cmListFileArgument::Unquoted, 0),
272 cmListFileArgument(path, cmListFileArgument::Quoted, 0) });
273 cmExecutionStatus status(*this->Makefile);
274
275 if (this->Makefile->ExecuteCommand(validator, status)) {
276 return this->Makefile->GetDefinition(resultName).IsOn();
277 }
278 return false;
279}
280
281void cmFindBase::ExpandPaths()
282{

Callers 3

FindHeaderInFrameworkMethod · 0.45
FindNormalHeaderMethod · 0.45
CheckDirectoryForNameMethod · 0.45

Calls 7

AddDefinitionBoolMethod · 0.80
ExecuteCommandMethod · 0.80
cmStrCatFunction · 0.70
cmListFileArgumentClass · 0.70
emptyMethod · 0.45
IsOnMethod · 0.45
GetDefinitionMethod · 0.45

Tested by

no test coverage detected