diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCustomCommandGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 4 |
3 files changed, 15 insertions, 5 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index cc0419d..64cd88e 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -53,11 +53,7 @@ std::vector<std::string> EvaluateOutputs(std::vector<std::string> const& paths, std::vector<std::string> outputs; for (std::string const& p : paths) { std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(p); - std::string const& ep = cge->Evaluate(lg, config); - cm::append(outputs, cmExpandedList(ep)); - } - for (std::string& p : outputs) { - p = cmSystemTools::CollapseFullPath(p, lg->GetCurrentBinaryDirectory()); + cm::append(outputs, lg->ExpandCustomCommandOutputPaths(*cge, config)); } return outputs; } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 832c36c..8a9cb04 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -4169,6 +4169,16 @@ cmSourceFile* cmLocalGenerator::GetSourceFileWithOutput( return nullptr; } +std::vector<std::string> cmLocalGenerator::ExpandCustomCommandOutputPaths( + cmCompiledGeneratorExpression const& cge, std::string const& config) +{ + std::vector<std::string> paths = cmExpandedList(cge.Evaluate(this, config)); + for (std::string& p : paths) { + p = cmSystemTools::CollapseFullPath(p, this->GetCurrentBinaryDirectory()); + } + return paths; +} + void cmLocalGenerator::AddTargetByproducts( cmTarget* target, const std::vector<std::string>& byproducts) { diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 9ed3b15..c246e2e 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -22,6 +22,7 @@ #include "cmProperty.h" #include "cmStateSnapshot.h" +class cmCompiledGeneratorExpression; class cmComputeLinkInformation; class cmCustomCommandGenerator; class cmCustomCommandLines; @@ -362,6 +363,9 @@ public: bool command_expand_lists = false, const std::string& job_pool = "", bool stdPipesUTF8 = false); + std::vector<std::string> ExpandCustomCommandOutputPaths( + cmCompiledGeneratorExpression const& cge, std::string const& config); + /** * Add target byproducts. */ |