diff options
Diffstat (limited to 'Source/cmCustomCommandGenerator.cxx')
-rw-r--r-- | Source/cmCustomCommandGenerator.cxx | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index f24dfa2..cebd9f5 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -18,10 +18,10 @@ //---------------------------------------------------------------------------- cmCustomCommandGenerator::cmCustomCommandGenerator( - cmCustomCommand const& cc, const char* config, cmMakefile* mf): + cmCustomCommand const& cc, const std::string& config, cmMakefile* mf): CC(cc), Config(config), Makefile(mf), LG(mf->GetLocalGenerator()), OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()), - GE(new cmGeneratorExpression(cc.GetBacktrace())) + GE(new cmGeneratorExpression(cc.GetBacktrace())), DependsDone(false) { } @@ -63,11 +63,49 @@ cmCustomCommandGenerator cmd += " "; if(this->OldStyle) { - cmd += this->LG->EscapeForShellOldStyle(arg.c_str()); + cmd += this->LG->EscapeForShellOldStyle(arg); } else { - cmd += this->LG->EscapeForShell(arg.c_str(), this->MakeVars); + cmd += this->LG->EscapeForShell(arg, this->MakeVars); } } } + +//---------------------------------------------------------------------------- +const char* cmCustomCommandGenerator::GetComment() const +{ + return this->CC.GetComment(); +} + +//---------------------------------------------------------------------------- +std::string cmCustomCommandGenerator::GetWorkingDirectory() const +{ + return this->CC.GetWorkingDirectory(); +} + +//---------------------------------------------------------------------------- +std::vector<std::string> const& cmCustomCommandGenerator::GetOutputs() const +{ + return this->CC.GetOutputs(); +} + +//---------------------------------------------------------------------------- +std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const +{ + if (!this->DependsDone) + { + this->DependsDone = true; + std::vector<std::string> depends = this->CC.GetDepends(); + for(std::vector<std::string>::const_iterator + i = depends.begin(); + i != depends.end(); ++i) + { + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge + = this->GE->Parse(*i); + cmSystemTools::ExpandListArgument( + cge->Evaluate(this->Makefile, this->Config), this->Depends); + } + } + return this->Depends; +} |