summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallDirectoryGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmInstallDirectoryGenerator.cxx')
-rw-r--r--Source/cmInstallDirectoryGenerator.cxx28
1 files changed, 24 insertions, 4 deletions
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index ea27f61..f2e8609 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -36,6 +36,16 @@ cmInstallDirectoryGenerator
{
this->ActionsPerConfig = true;
}
+
+ // We need per-config actions if any directories have generator expressions.
+ for(std::vector<std::string>::const_iterator i = dirs.begin();
+ !this->ActionsPerConfig && i != dirs.end(); ++i)
+ {
+ if(cmGeneratorExpression::Find(*i) != std::string::npos)
+ {
+ this->ActionsPerConfig = true;
+ }
+ }
}
//----------------------------------------------------------------------------
@@ -60,7 +70,7 @@ cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os,
}
else
{
- this->AddDirectoryInstallRule(os, "", indent);
+ this->AddDirectoryInstallRule(os, "", indent, this->Directories);
}
}
@@ -69,20 +79,30 @@ void cmInstallDirectoryGenerator::GenerateScriptForConfig(
const std::string& config,
Indent const& indent)
{
- this->AddDirectoryInstallRule(os, config, indent);
+ std::vector<std::string> dirs;
+ cmGeneratorExpression ge;
+ for(std::vector<std::string>::const_iterator i = this->Directories.begin();
+ i != this->Directories.end(); ++i)
+ {
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*i);
+ cmSystemTools::ExpandListArgument(cge->Evaluate(
+ this->LocalGenerator, config), dirs);
+ }
+ this->AddDirectoryInstallRule(os, config, indent, dirs);
}
void cmInstallDirectoryGenerator::AddDirectoryInstallRule(
std::ostream& os,
const std::string& config,
- Indent const& indent)
+ Indent const& indent,
+ std::vector<std::string> const& dirs)
{
// Write code to install the directories.
const char* no_rename = 0;
this->AddInstallRule(os,
this->GetDestination(config),
cmInstallType_DIRECTORY,
- this->Directories,
+ dirs,
this->Optional,
this->FilePermissions.c_str(),
this->DirPermissions.c_str(),