diff options
author | Robert Goulet <robert.goulet@autodesk.com> | 2015-09-23 13:40:27 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-23 14:37:17 -0400 |
commit | 17aa6fd36284ad937bfce370cf8d5e5de87a334b (patch) | |
tree | 2305380ddecce1f8de5c617c65c4ea729d347901 /Source/cmInstallFilesGenerator.cxx | |
parent | c3b3284c931d6368e4f100fc19ed8f2efdebd9fa (diff) | |
download | cmake-17aa6fd36284ad937bfce370cf8d5e5de87a334b.tar.gz |
install: Allow generator expressions in FILES DESTINATION
Diffstat (limited to 'Source/cmInstallFilesGenerator.cxx')
-rw-r--r-- | Source/cmInstallFilesGenerator.cxx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index c18b174b4a..e2c16c8f58 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -34,6 +34,12 @@ cmInstallFilesGenerator Programs(programs), Optional(optional) { + // We need per-config actions if the destination has generator expressions. + if(cmGeneratorExpression::Find(Destination) != std::string::npos) + { + this->ActionsPerConfig = true; + } + // We need per-config actions if any files have generator expressions. for(std::vector<std::string>::const_iterator i = files.begin(); !this->ActionsPerConfig && i != files.end(); ++i) @@ -57,14 +63,25 @@ void cmInstallFilesGenerator::Compute(cmLocalGenerator* lg) } //---------------------------------------------------------------------------- +std::string +cmInstallFilesGenerator::GetDestination(std::string const& config) const +{ + cmGeneratorExpression ge; + return ge.Parse(this->Destination) + ->Evaluate(this->LocalGenerator->GetMakefile(), config); +} + +//---------------------------------------------------------------------------- void cmInstallFilesGenerator::AddFilesInstallRule( - std::ostream& os, Indent const& indent, + std::ostream& os, + const std::string config, + Indent const& indent, std::vector<std::string> const& files) { // Write code to install the files. const char* no_dir_permissions = 0; this->AddInstallRule(os, - this->Destination, + this->GetDestination(config), (this->Programs ? cmInstallType_PROGRAMS : cmInstallType_FILES), @@ -84,7 +101,7 @@ void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os, } else { - this->AddFilesInstallRule(os, indent, this->Files); + this->AddFilesInstallRule(os, "", indent, this->Files); } } @@ -102,5 +119,5 @@ void cmInstallFilesGenerator::GenerateScriptForConfig(std::ostream& os, cmSystemTools::ExpandListArgument(cge->Evaluate( this->LocalGenerator->GetMakefile(), config), files); } - this->AddFilesInstallRule(os, indent, files); + this->AddFilesInstallRule(os, config, indent, files); } |