diff options
Diffstat (limited to 'Source/cmAuxSourceDirectoryCommand.cxx')
-rw-r--r-- | Source/cmAuxSourceDirectoryCommand.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index 45c6411..83199b4 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -7,28 +7,27 @@ #include <stddef.h> #include <utility> +#include "cmExecutionStatus.h" #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmake.h" -class cmExecutionStatus; - -// cmAuxSourceDirectoryCommand -bool cmAuxSourceDirectoryCommand::InitialPass( - std::vector<std::string> const& args, cmExecutionStatus&) +bool cmAuxSourceDirectoryCommand(std::vector<std::string> const& args, + cmExecutionStatus& status) { if (args.size() != 2) { - this->SetError("called with incorrect number of arguments"); + status.SetError("called with incorrect number of arguments"); return false; } + cmMakefile& mf = status.GetMakefile(); std::string sourceListValue; std::string const& templateDirectory = args[0]; std::string tdir; if (!cmSystemTools::FileIsFullPath(templateDirectory)) { - tdir = this->Makefile->GetCurrentSourceDirectory(); + tdir = mf.GetCurrentSourceDirectory(); tdir += "/"; tdir += templateDirectory; } else { @@ -36,7 +35,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass( } // was the list already populated - const char* def = this->Makefile->GetDefinition(args[1]); + const char* def = mf.GetDefinition(args[1]); if (def) { sourceListValue = def; } @@ -55,14 +54,14 @@ bool cmAuxSourceDirectoryCommand::InitialPass( std::string ext = file.substr(dotpos + 1); std::string base = file.substr(0, dotpos); // Process only source files - auto cm = this->Makefile->GetCMakeInstance(); + auto cm = mf.GetCMakeInstance(); if (!base.empty() && cm->IsSourceExtension(ext)) { std::string fullname = templateDirectory; fullname += "/"; fullname += file; // add the file as a class file so // depends can be done - cmSourceFile* sf = this->Makefile->GetOrCreateSource(fullname); + cmSourceFile* sf = mf.GetOrCreateSource(fullname); sf->SetProperty("ABSTRACT", "0"); files.push_back(std::move(fullname)); } @@ -74,6 +73,6 @@ bool cmAuxSourceDirectoryCommand::InitialPass( sourceListValue += ";"; } sourceListValue += cmJoin(files, ";"); - this->Makefile->AddDefinition(args[1], sourceListValue); + mf.AddDefinition(args[1], sourceListValue); return true; } |