Commit 947ba01b authored by Brad King's avatar Brad King
Browse files

cmLocalGenerator: Factor out helper to expand custom command output paths

parent 1902d28e
......@@ -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;
}
......
......@@ -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)
{
......
......@@ -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.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment