summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallFilesGenerator.cxx
diff options
context:
space:
mode:
authorDaniel Eiband <daniel.eiband@brainlab.com>2019-09-22 07:53:44 (GMT)
committerDaniel Eiband <daniel.eiband@brainlab.com>2019-09-23 19:19:15 (GMT)
commit7dcf9cb83c2082168f218be8f21b95b77cc95a86 (patch)
treeee1435acc933654c5d643e3ca5777670407f2cb1 /Source/cmInstallFilesGenerator.cxx
parentc7c59dae82594557dc2fddc4ef881dafeaad076a (diff)
downloadCMake-7dcf9cb83c2082168f218be8f21b95b77cc95a86.zip
CMake-7dcf9cb83c2082168f218be8f21b95b77cc95a86.tar.gz
CMake-7dcf9cb83c2082168f218be8f21b95b77cc95a86.tar.bz2
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
Diffstat (limited to 'Source/cmInstallFilesGenerator.cxx')
-rw-r--r--Source/cmInstallFilesGenerator.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index c4048d4..f5b69a5 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -6,8 +6,6 @@
#include "cmInstallType.h"
#include "cmStringAlgorithms.h"
-#include <memory>
-
class cmLocalGenerator;
cmInstallFilesGenerator::cmInstallFilesGenerator(
@@ -51,8 +49,8 @@ bool cmInstallFilesGenerator::Compute(cmLocalGenerator* lg)
std::string cmInstallFilesGenerator::GetDestination(
std::string const& config) const
{
- cmGeneratorExpression ge;
- return ge.Parse(this->Destination)->Evaluate(this->LocalGenerator, config);
+ return cmGeneratorExpression::Evaluate(this->Destination,
+ this->LocalGenerator, config);
}
void cmInstallFilesGenerator::AddFilesInstallRule(
@@ -82,10 +80,9 @@ void cmInstallFilesGenerator::GenerateScriptForConfig(
std::ostream& os, const std::string& config, Indent indent)
{
std::vector<std::string> files;
- cmGeneratorExpression ge;
for (std::string const& f : this->Files) {
- std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(f);
- cmExpandList(cge->Evaluate(this->LocalGenerator, config), files);
+ cmExpandList(
+ cmGeneratorExpression::Evaluate(f, this->LocalGenerator, config), files);
}
this->AddFilesInstallRule(os, config, indent, files);
}