diff options
author | Daniel Eiband <daniel.eiband@brainlab.com> | 2019-09-22 07:53:44 (GMT) |
---|---|---|
committer | Daniel Eiband <daniel.eiband@brainlab.com> | 2019-09-23 19:19:15 (GMT) |
commit | 7dcf9cb83c2082168f218be8f21b95b77cc95a86 (patch) | |
tree | ee1435acc933654c5d643e3ca5777670407f2cb1 /Source/cmInstallDirectoryGenerator.cxx | |
parent | c7c59dae82594557dc2fddc4ef881dafeaad076a (diff) | |
download | CMake-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/cmInstallDirectoryGenerator.cxx')
-rw-r--r-- | Source/cmInstallDirectoryGenerator.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx index 1d8210c..259c7f7 100644 --- a/Source/cmInstallDirectoryGenerator.cxx +++ b/Source/cmInstallDirectoryGenerator.cxx @@ -9,8 +9,6 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" -#include <memory> - cmInstallDirectoryGenerator::cmInstallDirectoryGenerator( std::vector<std::string> const& dirs, const char* dest, const char* file_permissions, const char* dir_permissions, @@ -64,10 +62,9 @@ void cmInstallDirectoryGenerator::GenerateScriptForConfig( std::ostream& os, const std::string& config, Indent indent) { std::vector<std::string> dirs; - cmGeneratorExpression ge; for (std::string const& d : this->Directories) { - std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(d); - cmExpandList(cge->Evaluate(this->LocalGenerator, config), dirs); + cmExpandList( + cmGeneratorExpression::Evaluate(d, this->LocalGenerator, config), dirs); } // Make sure all dirs have absolute paths. @@ -97,6 +94,6 @@ void cmInstallDirectoryGenerator::AddDirectoryInstallRule( std::string cmInstallDirectoryGenerator::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); } |