diff options
author | Brad King <brad.king@kitware.com> | 2016-05-17 13:33:02 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-05-17 13:33:02 (GMT) |
commit | 7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92 (patch) | |
tree | 2bdcf15abfef8e197173b5a135fe6b8391e43316 /Source/cmInstallFilesGenerator.cxx | |
parent | 930ac45cbafca79eec9ae68e07c547b5c81b8c2c (diff) | |
parent | d9fd2f5402eeaa345691313658e02b51038f570b (diff) | |
download | CMake-7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92.zip CMake-7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92.tar.gz CMake-7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92.tar.bz2 |
Merge topic 'clang-format-source'
d9fd2f54 Revise C++ coding style using clang-format
82df6dea Empty commit at end of history preceding clang-format style transition
6a13f43f CONTRIBUTING: Add a section on coding style
bf451d9f Add a script to run clang-format on the entire source tree
1e90d78f Configure clang-format for CMake source tree
da60adc3 Tell Git to use a distinct conflict marker size in `.rst` files
Diffstat (limited to 'Source/cmInstallFilesGenerator.cxx')
-rw-r--r-- | Source/cmInstallFilesGenerator.cxx | 99 |
1 files changed, 39 insertions, 60 deletions
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index a61c38e..a2cfc5a 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -16,44 +16,35 @@ #include "cmMakefile.h" #include "cmSystemTools.h" -cmInstallFilesGenerator -::cmInstallFilesGenerator(std::vector<std::string> const& files, - const char* dest, bool programs, - const char* file_permissions, - std::vector<std::string> const& configurations, - const char* component, - MessageLevel message, - bool exclude_from_all, - const char* rename, - bool optional): - cmInstallGenerator(dest, configurations, component, message, - exclude_from_all), - LocalGenerator(0), - Files(files), - FilePermissions(file_permissions), - Rename(rename), - Programs(programs), - Optional(optional) +cmInstallFilesGenerator::cmInstallFilesGenerator( + std::vector<std::string> const& files, const char* dest, bool programs, + const char* file_permissions, std::vector<std::string> const& configurations, + const char* component, MessageLevel message, bool exclude_from_all, + const char* rename, bool optional) + : cmInstallGenerator(dest, configurations, component, message, + exclude_from_all) + , LocalGenerator(0) + , Files(files) + , FilePermissions(file_permissions) + , Rename(rename) + , Programs(programs) + , Optional(optional) { // We need per-config actions if the destination has generator expressions. - if(cmGeneratorExpression::Find(Destination) != std::string::npos) - { + 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) - { - if(cmGeneratorExpression::Find(*i) != std::string::npos) - { + for (std::vector<std::string>::const_iterator i = files.begin(); + !this->ActionsPerConfig && i != files.end(); ++i) { + if (cmGeneratorExpression::Find(*i) != std::string::npos) { this->ActionsPerConfig = true; - } } + } } -cmInstallFilesGenerator -::~cmInstallFilesGenerator() +cmInstallFilesGenerator::~cmInstallFilesGenerator() { } @@ -62,58 +53,46 @@ void cmInstallFilesGenerator::Compute(cmLocalGenerator* lg) this->LocalGenerator = lg; } -std::string -cmInstallFilesGenerator::GetDestination(std::string const& config) const +std::string cmInstallFilesGenerator::GetDestination( + std::string const& config) const { cmGeneratorExpression ge; - return ge.Parse(this->Destination) - ->Evaluate(this->LocalGenerator, config); + return ge.Parse(this->Destination)->Evaluate(this->LocalGenerator, config); } void cmInstallFilesGenerator::AddFilesInstallRule( - std::ostream& os, - const std::string config, - 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->GetDestination(config), - (this->Programs - ? cmInstallType_PROGRAMS - : cmInstallType_FILES), - files, - this->Optional, - this->FilePermissions.c_str(), no_dir_permissions, - this->Rename.c_str(), 0, indent); + this->AddInstallRule( + os, this->GetDestination(config), + (this->Programs ? cmInstallType_PROGRAMS : cmInstallType_FILES), files, + this->Optional, this->FilePermissions.c_str(), no_dir_permissions, + this->Rename.c_str(), 0, indent); } void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os, Indent const& indent) { - if(this->ActionsPerConfig) - { + if (this->ActionsPerConfig) { this->cmInstallGenerator::GenerateScriptActions(os, indent); - } - else - { + } else { this->AddFilesInstallRule(os, "", indent, this->Files); - } + } } -void cmInstallFilesGenerator::GenerateScriptForConfig(std::ostream& os, - const std::string& config, - Indent const& indent) +void cmInstallFilesGenerator::GenerateScriptForConfig( + std::ostream& os, const std::string& config, Indent const& indent) { std::vector<std::string> files; cmGeneratorExpression ge; - for(std::vector<std::string>::const_iterator i = this->Files.begin(); - i != this->Files.end(); ++i) - { + for (std::vector<std::string>::const_iterator i = this->Files.begin(); + i != this->Files.end(); ++i) { cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*i); - cmSystemTools::ExpandListArgument(cge->Evaluate( - this->LocalGenerator, config), files); - } + cmSystemTools::ExpandListArgument( + cge->Evaluate(this->LocalGenerator, config), files); + } this->AddFilesInstallRule(os, config, indent, files); } |