diff options
author | Brad King <brad.king@kitware.com> | 2021-01-14 18:00:10 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-01-14 18:00:16 (GMT) |
commit | 967d1f7dde05769056a6431b7686939ccaa6d86a (patch) | |
tree | 30bdc80fd13c2844c2a1b9fc63966d8ebbb706cf /Source | |
parent | 7bdef757ab318a928d90cdc99350666cdaf9bfca (diff) | |
parent | ac3ccc393e359063f498a33696c1785672a28d40 (diff) | |
download | CMake-967d1f7dde05769056a6431b7686939ccaa6d86a.zip CMake-967d1f7dde05769056a6431b7686939ccaa6d86a.tar.gz CMake-967d1f7dde05769056a6431b7686939ccaa6d86a.tar.bz2 |
Merge topic 'install-FILES-rename-genex'
ac3ccc393e install(files): Support genex in rename option
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5694
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmInstallFilesGenerator.cxx | 14 | ||||
-rw-r--r-- | Source/cmInstallFilesGenerator.h | 1 |
2 files changed, 13 insertions, 2 deletions
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index c45000d..0a353e4 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -25,10 +25,14 @@ cmInstallFilesGenerator::cmInstallFilesGenerator( , Programs(programs) , Optional(optional) { - // We need per-config actions if the destination has generator expressions. + // We need per-config actions if the destination and rename have generator + // expressions. if (cmGeneratorExpression::Find(this->Destination) != std::string::npos) { this->ActionsPerConfig = true; } + if (cmGeneratorExpression::Find(this->Rename) != std::string::npos) { + this->ActionsPerConfig = true; + } // We need per-config actions if any directories have generator expressions. if (!this->ActionsPerConfig) { @@ -56,6 +60,12 @@ std::string cmInstallFilesGenerator::GetDestination( this->LocalGenerator, config); } +std::string cmInstallFilesGenerator::GetRename(std::string const& config) const +{ + return cmGeneratorExpression::Evaluate(this->Rename, this->LocalGenerator, + config); +} + void cmInstallFilesGenerator::AddFilesInstallRule( std::ostream& os, std::string const& config, Indent indent, std::vector<std::string> const& files) @@ -66,7 +76,7 @@ void cmInstallFilesGenerator::AddFilesInstallRule( os, this->GetDestination(config), (this->Programs ? cmInstallType_PROGRAMS : cmInstallType_FILES), files, this->Optional, this->FilePermissions.c_str(), no_dir_permissions, - this->Rename.c_str(), nullptr, indent); + this->GetRename(config).c_str(), nullptr, indent); } void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os, diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h index b5a1ef4..66145f4 100644 --- a/Source/cmInstallFilesGenerator.h +++ b/Source/cmInstallFilesGenerator.h @@ -31,6 +31,7 @@ public: bool Compute(cmLocalGenerator* lg) override; std::string GetDestination(std::string const& config) const; + std::string GetRename(std::string const& config) const; protected: void GenerateScriptActions(std::ostream& os, Indent indent) override; |