diff options
Diffstat (limited to 'Source/cmInstallProgramsCommand.cxx')
-rw-r--r-- | Source/cmInstallProgramsCommand.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index 6bb4409..2fd9bad 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx @@ -2,15 +2,20 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallProgramsCommand.h" +#include <cm/memory> + #include "cmExecutionStatus.h" #include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" #include "cmInstallFilesGenerator.h" #include "cmInstallGenerator.h" +#include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +class cmListFileBacktrace; + static void FinalAction(cmMakefile& makefile, std::string const& dest, std::vector<std::string> const& args); static std::string FindInstallSource(cmMakefile& makefile, const char* name); @@ -33,9 +38,10 @@ bool cmInstallProgramsCommand(std::vector<std::string> const& args, std::string const& dest = args[0]; std::vector<std::string> const finalArgs(args.begin() + 1, args.end()); - mf.AddFinalAction([dest, finalArgs](cmMakefile& makefile) { - FinalAction(makefile, dest, finalArgs); - }); + mf.AddGeneratorAction( + [dest, finalArgs](cmLocalGenerator& lg, const cmListFileBacktrace&) { + FinalAction(*lg.GetMakefile(), dest, finalArgs); + }); return true; } @@ -91,7 +97,7 @@ static void FinalAction(cmMakefile& makefile, std::string const& dest, std::vector<std::string> no_configurations; cmInstallGenerator::MessageLevel message = cmInstallGenerator::SelectMessageLevel(&makefile); - makefile.AddInstallGenerator(new cmInstallFilesGenerator( + makefile.AddInstallGenerator(cm::make_unique<cmInstallFilesGenerator>( files, destination.c_str(), true, no_permissions, no_configurations, no_component.c_str(), message, no_exclude_from_all, no_rename)); } |