diff options
Diffstat (limited to 'Source/cmAddCustomTargetCommand.cxx')
| -rw-r--r-- | Source/cmAddCustomTargetCommand.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 2b19aad..a246d06 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -4,13 +4,15 @@ #include <utility> +#include <cm/memory> + +#include "cmCustomCommand.h" #include "cmCustomCommandLines.h" #include "cmExecutionStatus.h" #include "cmGeneratorExpression.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmMessageType.h" -#include "cmPolicies.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" @@ -211,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, mf.GetPolicyStatus(cmPolicies::CMP0116), 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); |
