mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 22:30:13 -06:00
cmInstallDirectoryGenerator: Factor out method to get list of directories
This commit is contained in:
@@ -50,6 +50,22 @@ bool cmInstallDirectoryGenerator::Compute(cmLocalGenerator* lg)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<std::string> cmInstallDirectoryGenerator::GetDirectories(
|
||||
std::string const& config) const
|
||||
{
|
||||
std::vector<std::string> directories;
|
||||
if (this->ActionsPerConfig) {
|
||||
for (std::string const& f : this->Directories) {
|
||||
cmExpandList(
|
||||
cmGeneratorExpression::Evaluate(f, this->LocalGenerator, config),
|
||||
directories);
|
||||
}
|
||||
} else {
|
||||
directories = this->Directories;
|
||||
}
|
||||
return directories;
|
||||
}
|
||||
|
||||
void cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os,
|
||||
Indent indent)
|
||||
{
|
||||
@@ -63,11 +79,7 @@ void cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os,
|
||||
void cmInstallDirectoryGenerator::GenerateScriptForConfig(
|
||||
std::ostream& os, const std::string& config, Indent indent)
|
||||
{
|
||||
std::vector<std::string> dirs;
|
||||
for (std::string const& d : this->Directories) {
|
||||
cmExpandList(
|
||||
cmGeneratorExpression::Evaluate(d, this->LocalGenerator, config), dirs);
|
||||
}
|
||||
std::vector<std::string> dirs = this->GetDirectories(config);
|
||||
|
||||
// Make sure all dirs have absolute paths.
|
||||
cmMakefile const& mf = *this->LocalGenerator->GetMakefile();
|
||||
|
||||
@@ -32,6 +32,9 @@ public:
|
||||
bool Compute(cmLocalGenerator* lg) override;
|
||||
|
||||
std::string GetDestination(std::string const& config) const;
|
||||
std::vector<std::string> GetDirectories(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