cmCustomCommand: Refactor with unique_ptr
Abstract
- Introduce setters in
cmCustomCommand
. Prune a constructor with positional parameters. - Hoist creating
cmCustomCommand
tocmAddCustom*.cxx
. - No behavior changes intended.
Goal
- To add a property to
add_custom_command
, we can simply editcmCustomCommand
and its users.
A problem
- To add a property to
add_custom_command
, so many changes would be required. -
cmCustomCommand::cmCustomCommand(...)
is used with default parameters in many places. Positional parameters are not suitable there.
About this branch
- I split commits unsquashed intentionally. I am certain it will help step-by-step confirmation. I can squash them later.
- Tested only on Linux.
TODO(I don't do for now)
- I discovered that
std::move()
could be applied to many setters. I didn't do for now, since most of them would be the paths I don't use usually. Feel free to try applyingstd::move()
.
Known problem
- in
Source/cmGlobalVisualStudio8Generator.cxx
,stdPipesUTF8
was set tocc::escapeOldStyle
. I guess it would be unintentional.
Topic-rename: custom-command-unique_ptr
Edited by Brad King