summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallFilesCommand.cxx
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2019-09-12 08:18:01 (GMT)
committerRegina Pfeifer <regina@mailbox.org>2019-09-12 16:16:17 (GMT)
commitfb5affe0859ae1bc07d059fc11cee3daca4d8780 (patch)
treea59c827bc5525ff0867fd4dea5e9668994dc30ee /Source/cmInstallFilesCommand.cxx
parent242d876d7b919fe6efb3a347dfa35a66e3ef58df (diff)
downloadCMake-fb5affe0859ae1bc07d059fc11cee3daca4d8780.zip
CMake-fb5affe0859ae1bc07d059fc11cee3daca4d8780.tar.gz
CMake-fb5affe0859ae1bc07d059fc11cee3daca4d8780.tar.bz2
cmInstallFilesCommand: Port away from cmCommand
Ref: #19499
Diffstat (limited to 'Source/cmInstallFilesCommand.cxx')
-rw-r--r--Source/cmInstallFilesCommand.cxx23
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx
index 4eb5f24..d623943 100644
--- a/Source/cmInstallFilesCommand.cxx
+++ b/Source/cmInstallFilesCommand.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmInstallFilesCommand.h"
+#include "cmExecutionStatus.h"
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmInstallFilesGenerator.h"
@@ -11,8 +12,6 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
-class cmExecutionStatus;
-
static std::string FindInstallSource(cmMakefile& makefile, const char* name);
static void CreateInstallGenerator(cmMakefile& makefile,
std::string const& dest,
@@ -20,16 +19,18 @@ static void CreateInstallGenerator(cmMakefile& makefile,
static void FinalAction(cmMakefile& makefile, std::string const& dest,
std::vector<std::string> const& args);
-bool cmInstallFilesCommand::InitialPass(std::vector<std::string> const& args,
- cmExecutionStatus&)
+bool cmInstallFilesCommand(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();
+
// Enable the install target.
- this->Makefile->GetGlobalGenerator()->EnableInstallTarget();
+ mf.GetGlobalGenerator()->EnableInstallTarget();
std::string const& dest = args[0];
@@ -37,18 +38,18 @@ bool cmInstallFilesCommand::InitialPass(std::vector<std::string> const& args,
std::vector<std::string> files;
for (std::string const& arg : cmMakeRange(args).advance(2)) {
// Find the source location for each file listed.
- files.push_back(FindInstallSource(*this->Makefile, arg.c_str()));
+ files.push_back(FindInstallSource(mf, arg.c_str()));
}
- CreateInstallGenerator(*this->Makefile, dest, files);
+ CreateInstallGenerator(mf, dest, files);
} else {
std::vector<std::string> finalArgs(args.begin() + 1, args.end());
- this->Makefile->AddFinalAction([dest, finalArgs](cmMakefile& makefile) {
+ mf.AddFinalAction([dest, finalArgs](cmMakefile& makefile) {
FinalAction(makefile, dest, finalArgs);
});
}
- this->Makefile->GetGlobalGenerator()->AddInstallComponent(
- this->Makefile->GetSafeDefinition("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"));
+ mf.GetGlobalGenerator()->AddInstallComponent(
+ mf.GetSafeDefinition("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"));
return true;
}