summaryrefslogtreecommitdiffstats
path: root/Source/cmAuxSourceDirectoryCommand.cxx
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2019-08-06 21:10:04 (GMT)
committerRegina Pfeifer <regina@mailbox.org>2019-08-07 08:16:32 (GMT)
commit9ba0bf60c6a1dc0904c40575efd69bba580b0902 (patch)
tree1e16db46ba7409495923d29efb1c541f4e35eb24 /Source/cmAuxSourceDirectoryCommand.cxx
parent52d9cd624fc0da9b26fd677d92e67dd033603337 (diff)
downloadCMake-9ba0bf60c6a1dc0904c40575efd69bba580b0902.zip
CMake-9ba0bf60c6a1dc0904c40575efd69bba580b0902.tar.gz
CMake-9ba0bf60c6a1dc0904c40575efd69bba580b0902.tar.bz2
cmA*Command: Turn into free functions
Ref: #19499
Diffstat (limited to 'Source/cmAuxSourceDirectoryCommand.cxx')
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx21
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;
}