cmGetDirectoryPropertyCommand: Extract StoreResult method.
This commit is contained in:
parent
d17aa60659
commit
8fc53c3ce8
|
@ -89,12 +89,18 @@ bool cmGetDirectoryPropertyCommand
|
||||||
{
|
{
|
||||||
prop = dir->GetProperty(*i);
|
prop = dir->GetProperty(*i);
|
||||||
}
|
}
|
||||||
if (prop)
|
this->StoreResult(variable, prop);
|
||||||
{
|
|
||||||
this->Makefile->AddDefinition(variable, prop);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
this->Makefile->AddDefinition(variable, "");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmGetDirectoryPropertyCommand::StoreResult(std::string const& variable,
|
||||||
|
const char* prop)
|
||||||
|
{
|
||||||
|
if (prop)
|
||||||
|
{
|
||||||
|
this->Makefile->AddDefinition(variable, prop);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this->Makefile->AddDefinition(variable, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,9 @@ public:
|
||||||
virtual std::string GetName() const { return "get_directory_property";}
|
virtual std::string GetName() const { return "get_directory_property";}
|
||||||
|
|
||||||
cmTypeMacro(cmGetDirectoryPropertyCommand, cmCommand);
|
cmTypeMacro(cmGetDirectoryPropertyCommand, cmCommand);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void StoreResult(const std::string& variable, const char* prop);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue