diff options
author | Brad King <brad.king@kitware.com> | 2009-03-16 14:39:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-03-16 14:39:56 (GMT) |
commit | e67f5138b80b3b04844f3f5c0a3c69796266f9e6 (patch) | |
tree | 918dfffdd191602494e888ce72e3afaf797fbe9f /Source/cmInstallTargetGenerator.cxx | |
parent | e30835345abd1d05891c383506cadbc08ec51ccf (diff) | |
download | CMake-e67f5138b80b3b04844f3f5c0a3c69796266f9e6.zip CMake-e67f5138b80b3b04844f3f5c0a3c69796266f9e6.tar.gz CMake-e67f5138b80b3b04844f3f5c0a3c69796266f9e6.tar.bz2 |
ENH: Refactor cmInstallGenerator for re-use
A new cmScriptGenerator base class factors out the non-install-specific
part of cmInstallGenerator. This will be useful for other generators
that want per-configuration functionality.
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index fabcb0a..b8df71e 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -33,6 +33,7 @@ cmInstallTargetGenerator cmInstallGenerator(dest, configurations, component), Target(&t), ImportLibrary(implib), FilePermissions(file_permissions), Optional(optional) { + this->ActionsPerConfig = true; this->NamelinkMode = NamelinkModeNone; this->Target->SetHaveInstallRule(true); } @@ -76,48 +77,6 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os) } //---------------------------------------------------------------------------- -void cmInstallTargetGenerator::GenerateScriptConfigs(std::ostream& os, - Indent const& indent) -{ - if(this->ConfigurationTypes->empty()) - { - // In a single-configuration generator, only the install rule's - // configuration test is important. If that passes, the target is - // installed regardless of for what configuration it was built. - this->cmInstallGenerator::GenerateScriptConfigs(os, indent); - } - else - { - // In a multi-configuration generator, a separate rule is produced - // in a block for each configuration that is built. However, the - // list of configurations is restricted to those for which this - // install rule applies. - for(std::vector<std::string>::const_iterator i = - this->ConfigurationTypes->begin(); - i != this->ConfigurationTypes->end(); ++i) - { - const char* config = i->c_str(); - if(this->InstallsForConfig(config)) - { - // Generate a per-configuration block. - std::string config_test = this->CreateConfigTest(config); - os << indent << "IF(" << config_test << ")\n"; - this->GenerateScriptForConfig(os, config, indent.Next()); - os << indent << "ENDIF(" << config_test << ")\n"; - } - } - } -} - -//---------------------------------------------------------------------------- -void cmInstallTargetGenerator::GenerateScriptActions(std::ostream& os, - Indent const& indent) -{ - // This is reached for single-configuration generators only. - this->GenerateScriptForConfig(os, this->ConfigurationName, indent); -} - -//---------------------------------------------------------------------------- void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os, const char* config, Indent const& indent) |