diff options
author | Brad King <brad.king@kitware.com> | 2018-10-11 12:14:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-11 12:14:48 (GMT) |
commit | fd0e40f1667ed7e835d5a6fcbcf3b4d6489dff2c (patch) | |
tree | 5ca0ecf21fcd73214f878c34e77a23a3b7ec38b2 /Source/cmInstallScriptGenerator.cxx | |
parent | e2dd6ac9776e4f5a1995dfc606480b627fdbce72 (diff) | |
parent | 0f48fbaa72fa254faaed6b586fcaa5d3c5c77798 (diff) | |
download | CMake-fd0e40f1667ed7e835d5a6fcbcf3b4d6489dff2c.zip CMake-fd0e40f1667ed7e835d5a6fcbcf3b4d6489dff2c.tar.gz CMake-fd0e40f1667ed7e835d5a6fcbcf3b4d6489dff2c.tar.bz2 |
Merge branch 'backport-revert-install-code-script-genex' into revert-install-code-script-genex
Diffstat (limited to 'Source/cmInstallScriptGenerator.cxx')
-rw-r--r-- | Source/cmInstallScriptGenerator.cxx | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx index 1d7784e..7d77b7c 100644 --- a/Source/cmInstallScriptGenerator.cxx +++ b/Source/cmInstallScriptGenerator.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallScriptGenerator.h" -#include "cmGeneratorExpression.h" #include "cmScriptGenerator.h" #include <ostream> @@ -17,47 +16,24 @@ cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script, , Script(script) , Code(code) { - // We need per-config actions if the script has generator expressions. - if (cmGeneratorExpression::Find(Script) != std::string::npos) { - this->ActionsPerConfig = true; - } } cmInstallScriptGenerator::~cmInstallScriptGenerator() { } -void cmInstallScriptGenerator::Compute(cmLocalGenerator* lg) +void cmInstallScriptGenerator::GenerateScript(std::ostream& os) { - this->LocalGenerator = lg; -} + Indent indent; + std::string component_test = + this->CreateComponentTest(this->Component.c_str(), this->ExcludeFromAll); + os << indent << "if(" << component_test << ")\n"; -void cmInstallScriptGenerator::AddScriptInstallRule(std::ostream& os, - Indent indent, - std::string const& script) -{ if (this->Code) { - os << indent << script << "\n"; - } else { - os << indent << "include(\"" << script << "\")\n"; - } -} - -void cmInstallScriptGenerator::GenerateScriptActions(std::ostream& os, - Indent indent) -{ - if (this->ActionsPerConfig) { - this->cmInstallGenerator::GenerateScriptActions(os, indent); + os << indent << this->Script << "\n"; } else { - this->AddScriptInstallRule(os, indent, this->Script); + os << indent << "include(\"" << this->Script << "\")\n"; } -} -void cmInstallScriptGenerator::GenerateScriptForConfig( - std::ostream& os, const std::string& config, Indent indent) -{ - cmGeneratorExpression ge; - std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(this->Script); - this->AddScriptInstallRule(os, indent, - cge->Evaluate(this->LocalGenerator, config)); + os << indent << "endif()\n\n"; } |