Browse Source

cmCustomCommandGenerator: Evaluate generator expressions in outputs

This was already done for byproducts by commit a583b7bc17 (Genex:
Evaluate byproduct generator expressions in cmCustomCommandGenerator,
2019-09-11, v3.16.0-rc1~86^2).  Like that commit, this does not actually
expose the feature to projects because the front-end commands still
reject generator expressions.

Issue: #12877
Brad King 5 years ago
parent
commit
24156c0269
2 changed files with 3 additions and 1 deletions
  1. 2 1
      Source/cmCustomCommandGenerator.cxx
  2. 1 0
      Source/cmCustomCommandGenerator.h

+ 2 - 1
Source/cmCustomCommandGenerator.cxx

@@ -121,6 +121,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
     this->CommandLines.push_back(std::move(argv));
   }
 
+  AppendPaths(cc.GetOutputs(), ge, this->LG, this->Config, this->Outputs);
   AppendPaths(cc.GetByproducts(), ge, this->LG, this->Config,
               this->Byproducts);
   AppendPaths(cc.GetDepends(), ge, this->LG, this->Config, this->Depends);
@@ -326,7 +327,7 @@ std::string cmCustomCommandGenerator::GetWorkingDirectory() const
 
 std::vector<std::string> const& cmCustomCommandGenerator::GetOutputs() const
 {
-  return this->CC->GetOutputs();
+  return this->Outputs;
 }
 
 std::vector<std::string> const& cmCustomCommandGenerator::GetByproducts() const

+ 1 - 0
Source/cmCustomCommandGenerator.h

@@ -24,6 +24,7 @@ class cmCustomCommandGenerator
   bool MakeVars;
   cmCustomCommandLines CommandLines;
   std::vector<std::vector<std::string>> EmulatorsWithArguments;
+  std::vector<std::string> Outputs;
   std::vector<std::string> Byproducts;
   std::vector<std::string> Depends;
   std::string WorkingDirectory;