From d55319c01d5482ff31166750717252e1b49f1e69 Mon Sep 17 00:00:00 2001 From: Regina Pfeifer Date: Thu, 12 Sep 2019 10:19:23 +0200 Subject: cmInstallProgramsCommand: Port away from cmCommand Ref: #19499 --- Source/cmInstallProgramsCommand.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Source/cmInstallProgramsCommand.cxx') diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index 31a18b5d7e..6bb4409d5a 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallProgramsCommand.h" +#include "cmExecutionStatus.h" #include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" #include "cmInstallFilesGenerator.h" @@ -10,30 +11,29 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" -class cmExecutionStatus; - static void FinalAction(cmMakefile& makefile, std::string const& dest, std::vector const& args); static std::string FindInstallSource(cmMakefile& makefile, const char* name); -// cmExecutableCommand -bool cmInstallProgramsCommand::InitialPass( - std::vector const& args, cmExecutionStatus&) +bool cmInstallProgramsCommand(std::vector 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(); - this->Makefile->GetGlobalGenerator()->AddInstallComponent( - this->Makefile->GetSafeDefinition("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME")); + mf.GetGlobalGenerator()->AddInstallComponent( + mf.GetSafeDefinition("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME")); std::string const& dest = args[0]; std::vector const finalArgs(args.begin() + 1, args.end()); - this->Makefile->AddFinalAction([dest, finalArgs](cmMakefile& makefile) { + mf.AddFinalAction([dest, finalArgs](cmMakefile& makefile) { FinalAction(makefile, dest, finalArgs); }); return true; -- cgit v1.2.1