mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
cmInstallFilesGenerator: Factor out method to get list of files
This commit is contained in:
@@ -66,6 +66,22 @@ std::string cmInstallFilesGenerator::GetRename(std::string const& config) const
|
||||
config);
|
||||
}
|
||||
|
||||
std::vector<std::string> cmInstallFilesGenerator::GetFiles(
|
||||
std::string const& config) const
|
||||
{
|
||||
std::vector<std::string> files;
|
||||
if (this->ActionsPerConfig) {
|
||||
for (std::string const& f : this->Files) {
|
||||
cmExpandList(
|
||||
cmGeneratorExpression::Evaluate(f, this->LocalGenerator, config),
|
||||
files);
|
||||
}
|
||||
} else {
|
||||
files = this->Files;
|
||||
}
|
||||
return files;
|
||||
}
|
||||
|
||||
void cmInstallFilesGenerator::AddFilesInstallRule(
|
||||
std::ostream& os, std::string const& config, Indent indent,
|
||||
std::vector<std::string> const& files)
|
||||
@@ -92,10 +108,6 @@ void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os,
|
||||
void cmInstallFilesGenerator::GenerateScriptForConfig(
|
||||
std::ostream& os, const std::string& config, Indent indent)
|
||||
{
|
||||
std::vector<std::string> files;
|
||||
for (std::string const& f : this->Files) {
|
||||
cmExpandList(
|
||||
cmGeneratorExpression::Evaluate(f, this->LocalGenerator, config), files);
|
||||
}
|
||||
std::vector<std::string> files = this->GetFiles(config);
|
||||
this->AddFilesInstallRule(os, config, indent, files);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ public:
|
||||
|
||||
std::string GetDestination(std::string const& config) const;
|
||||
std::string GetRename(std::string const& config) const;
|
||||
std::vector<std::string> GetFiles(std::string const& config) const;
|
||||
bool GetOptional() const { return this->Optional; }
|
||||
|
||||
protected:
|
||||
void GenerateScriptActions(std::ostream& os, Indent indent) override;
|
||||
|
||||
Reference in New Issue
Block a user