diff options
author | Brad King <brad.king@kitware.com> | 2018-10-11 10:59:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-11 11:05:55 (GMT) |
commit | 0f48fbaa72fa254faaed6b586fcaa5d3c5c77798 (patch) | |
tree | 38520add1b903a77bdd51af9789c3cab9c869148 /Source/cmInstallScriptGenerator.cxx | |
parent | fd02538974dd952a8639d371c2c0067d30d5469a (diff) | |
download | CMake-0f48fbaa72fa254faaed6b586fcaa5d3c5c77798.zip CMake-0f48fbaa72fa254faaed6b586fcaa5d3c5c77798.tar.gz CMake-0f48fbaa72fa254faaed6b586fcaa5d3c5c77798.tar.bz2 |
install: Revert CODE,SCRIPT support for generator expressions
Revert commit v3.13.0-rc1~441^2 (install: Teach CODE,SCRIPT modes to
evaluate generator expressions, 2018-05-29). Unfortunately it has
been found to break existing code in a real project, e.g.
install(CODE [[
message("$<FOOBAR>")
]])
Address this regression by reverting support for the 3.13 release
series. Support can be restored later with a policy for compatibility.
Issue: #15785
Fixes: #18435
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 3a90f4c..f7e6e44 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.Next() << script << "\n"; - } else { - os << indent.Next() << "include(\"" << script << "\")\n"; - } -} - -void cmInstallScriptGenerator::GenerateScriptActions(std::ostream& os, - Indent indent) -{ - if (this->ActionsPerConfig) { - this->cmInstallGenerator::GenerateScriptActions(os, indent); + os << indent.Next() << this->Script << "\n"; } else { - this->AddScriptInstallRule(os, indent, this->Script); + os << indent.Next() << "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"; } |