diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-07-25 17:52:10 +0200 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-07-27 20:09:38 +0200 |
commit | d568eefe104e480706a2e6ceb16df4376d4becbf (patch) | |
tree | 60aee888508ff833db298c7d9ed7fdeee2cfe89b /Source/cmCustomCommandGenerator.cxx | |
parent | 26d1a9d356ad3122f7d07dcd93d12767726807cf (diff) | |
download | cmake-d568eefe104e480706a2e6ceb16df4376d4becbf.tar.gz |
cmCustomCommandGenerator: Require cmLocalGenerator in API.
Diffstat (limited to 'Source/cmCustomCommandGenerator.cxx')
-rw-r--r-- | Source/cmCustomCommandGenerator.cxx | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index f654eb9e40..8483a91709 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -12,14 +12,15 @@ #include "cmCustomCommandGenerator.h" #include "cmMakefile.h" +#include "cmLocalGenerator.h" #include "cmCustomCommand.h" #include "cmOutputConverter.h" #include "cmGeneratorExpression.h" //---------------------------------------------------------------------------- cmCustomCommandGenerator::cmCustomCommandGenerator( - cmCustomCommand const& cc, const std::string& config, cmMakefile* mf): - CC(cc), Config(config), Makefile(mf), + cmCustomCommand const& cc, const std::string& config, cmLocalGenerator* lg): + CC(cc), Config(config), LG(lg), OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()), GE(new cmGeneratorExpression(cc.GetBacktrace())), DependsDone(false) { @@ -41,13 +42,15 @@ unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const { std::string const& argv0 = this->CC.GetCommandLines()[c][0]; - cmTarget* target = this->Makefile->FindTargetToUse(argv0); + cmTarget* target = this->LG->GetMakefile()->FindTargetToUse(argv0); if(target && target->GetType() == cmTarget::EXECUTABLE && - (target->IsImported() || !this->Makefile->IsOn("CMAKE_CROSSCOMPILING"))) + (target->IsImported() + || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING"))) { return target->GetLocation(this->Config); } - return this->GE->Parse(argv0)->Evaluate(this->Makefile, this->Config); + return this->GE->Parse(argv0)->Evaluate(this->LG->GetMakefile(), + this->Config); } //---------------------------------------------------------------------------- @@ -87,8 +90,9 @@ cmCustomCommandGenerator cmCustomCommandLine const& commandLine = this->CC.GetCommandLines()[c]; for(unsigned int j=1;j < commandLine.size(); ++j) { - std::string arg = this->GE->Parse(commandLine[j])->Evaluate(this->Makefile, - this->Config); + std::string arg = + this->GE->Parse(commandLine[j])->Evaluate(this->LG->GetMakefile(), + this->Config); cmd += " "; if(this->OldStyle) { @@ -96,7 +100,7 @@ cmCustomCommandGenerator } else { - cmOutputConverter converter(this->Makefile->GetStateSnapshot()); + cmOutputConverter converter(this->LG->GetMakefile()->GetStateSnapshot()); cmd += converter.EscapeForShell(arg, this->MakeVars); } } @@ -141,7 +145,7 @@ std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const = this->GE->Parse(*i); std::vector<std::string> result; cmSystemTools::ExpandListArgument( - cge->Evaluate(this->Makefile, this->Config), result); + cge->Evaluate(this->LG->GetMakefile(), this->Config), result); for (std::vector<std::string>::iterator it = result.begin(); it != result.end(); ++it) { |