cmGeneratorExpression: Add cmGeneratorExpression::Evaluate utility

cmGeneratorExpression::Evaluate is a shortcut when only the evaluated string is
needed or an instance of cmCompiledGeneratorExpression cannot be cached.

Fixes: #19686
This commit is contained in:
Daniel Eiband
2019-09-22 09:53:44 +02:00
parent c7c59dae82
commit 7dcf9cb83c
17 changed files with 122 additions and 158 deletions
+2 -5
View File
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmInstallScriptGenerator.h"
#include <memory>
#include <ostream>
#include <vector>
@@ -79,11 +78,9 @@ void cmInstallScriptGenerator::GenerateScriptForConfig(
std::ostream& os, const std::string& config, Indent indent)
{
if (this->AllowGenex) {
cmGeneratorExpression ge;
std::unique_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(this->Script);
this->AddScriptInstallRule(os, indent,
cge->Evaluate(this->LocalGenerator, config));
cmGeneratorExpression::Evaluate(
this->Script, this->LocalGenerator, config));
} else {
this->AddScriptInstallRule(os, indent, this->Script);
}