summaryrefslogtreecommitdiffstats
path: root/Source/cmCustomCommand.h
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2021-11-01 14:19:05 (GMT)
committerBrad King <brad.king@kitware.com>2021-11-18 17:02:37 (GMT)
commit9b31a977481ea07c979549246ee46946e9978e08 (patch)
tree07b8d6b8618140ed066c8b1d3efe37c0bd994233 /Source/cmCustomCommand.h
parentd0158b765b0660bcfe304830e179fa9bbdffd5d9 (diff)
downloadCMake-9b31a977481ea07c979549246ee46946e9978e08.zip
CMake-9b31a977481ea07c979549246ee46946e9978e08.tar.gz
CMake-9b31a977481ea07c979549246ee46946e9978e08.tar.bz2
cmCustomCommand: Move constructor arguments to individual setters
Make `cmCustomCommand` have just only default constructor. Use each setter instead. This follows the builder pattern. Introduce `cc::SetOutputs(std::string output)`. This will be used later, as substitution for `cc::SetOutputs({output})`.
Diffstat (limited to 'Source/cmCustomCommand.h')
-rw-r--r--Source/cmCustomCommand.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h
index 5cbd3d1..5ae26dd 100644
--- a/Source/cmCustomCommand.h
+++ b/Source/cmCustomCommand.h
@@ -25,22 +25,18 @@ class cmImplicitDependsList
class cmCustomCommand
{
public:
- /** Main constructor specifies all information for the command. */
- cmCustomCommand(std::vector<std::string> outputs,
- std::vector<std::string> byproducts,
- std::vector<std::string> depends,
- cmCustomCommandLines commandLines, cmListFileBacktrace lfbt,
- const char* comment, const char* workingDirectory,
- bool stdPipesUTF8);
-
/** Get the output file produced by the command. */
const std::vector<std::string>& GetOutputs() const;
+ void SetOutputs(std::vector<std::string> outputs);
+ void SetOutputs(std::string output);
/** Get the extra files produced by the command. */
const std::vector<std::string>& GetByproducts() const;
+ void SetByproducts(std::vector<std::string> byproducts);
/** Get the vector that holds the list of dependencies. */
const std::vector<std::string>& GetDepends() const;
+ void SetDepends(std::vector<std::string> depends);
/** Get the working directory. */
std::string const& GetWorkingDirectory() const
@@ -48,14 +44,25 @@ public:
return this->WorkingDirectory;
}
+ void SetWorkingDirectory(const char* workingDirectory)
+ {
+ this->WorkingDirectory = (workingDirectory ? workingDirectory : "");
+ }
+
/** Get the list of command lines. */
const cmCustomCommandLines& GetCommandLines() const;
+ void SetCommandLines(cmCustomCommandLines commandLines);
/** Get the comment string for the command. */
const char* GetComment() const;
+ void SetComment(const char* comment);
/** Get a value indicating if the command uses UTF-8 output pipes. */
bool GetStdPipesUTF8() const { return this->StdPipesUTF8; }
+ void SetStdPipesUTF8(bool stdPipesUTF8)
+ {
+ this->StdPipesUTF8 = stdPipesUTF8;
+ }
/** Append to the list of command lines. */
void AppendCommands(const cmCustomCommandLines& commandLines);
@@ -74,6 +81,7 @@ public:
/** Backtrace of the command that created this custom command. */
cmListFileBacktrace const& GetBacktrace() const;
+ void SetBacktrace(cmListFileBacktrace lfbt);
void SetImplicitDepends(cmImplicitDependsList const&);
void AppendImplicitDepends(cmImplicitDependsList const&);