diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2021-11-07 15:25:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-11-18 17:02:38 (GMT) |
commit | 3bb2542535fa2ca1e78195b69c53916a55d322e1 (patch) | |
tree | 807f1bb4f08bdca8360c4f76b0150cefb0490177 /Source/cmAddCustomTargetCommand.cxx | |
parent | c46b041a3bcede9447c36de2f3359eb4c17f3f50 (diff) | |
download | CMake-3bb2542535fa2ca1e78195b69c53916a55d322e1.zip CMake-3bb2542535fa2ca1e78195b69c53916a55d322e1.tar.gz CMake-3bb2542535fa2ca1e78195b69c53916a55d322e1.tar.bz2 |
cmMakefile: Simplify Add*Command and adopt to cmAddCustom*Command
Diffstat (limited to 'Source/cmAddCustomTargetCommand.cxx')
-rw-r--r-- | Source/cmAddCustomTargetCommand.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 104065f..a246d06 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -4,6 +4,9 @@ #include <utility> +#include <cm/memory> + +#include "cmCustomCommand.h" #include "cmCustomCommandLines.h" #include "cmExecutionStatus.h" #include "cmGeneratorExpression.h" @@ -210,11 +213,18 @@ bool cmAddCustomTargetCommand(std::vector<std::string> const& args, } // Add the utility target to the makefile. - bool escapeOldStyle = !verbatim; - cmTarget* target = mf.AddUtilityCommand( - targetName, excludeFromAll, working_directory.c_str(), byproducts, depends, - commandLines, escapeOldStyle, comment, uses_terminal, command_expand_lists, - job_pool); + auto cc = cm::make_unique<cmCustomCommand>(); + cc->SetWorkingDirectory(working_directory.c_str()); + cc->SetByproducts(byproducts); + cc->SetDepends(depends); + cc->SetCommandLines(commandLines); + cc->SetEscapeOldStyle(!verbatim); + cc->SetComment(comment); + cc->SetUsesTerminal(uses_terminal); + cc->SetCommandExpandLists(command_expand_lists); + cc->SetJobPool(job_pool); + cmTarget* target = + mf.AddUtilityCommand(targetName, excludeFromAll, std::move(cc)); // Add additional user-specified source files to the target. target->AddSources(sources); |