summaryrefslogtreecommitdiffstats
path: root/Source/cmCustomCommandLines.cxx
diff options
context:
space:
mode:
authorDaniel Eiband <daniel.eiband@brainlab.com>2019-09-13 17:44:37 (GMT)
committerDaniel Eiband <daniel.eiband@brainlab.com>2019-09-16 18:45:41 (GMT)
commit7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d (patch)
treefed5733ab7c5219c0f5377a2b3fcb2674ac27b55 /Source/cmCustomCommandLines.cxx
parent1ac4e0ef1b29affc9e4f2cd86c4fc8c2252f2ab2 (diff)
downloadCMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.zip
CMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.tar.gz
CMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.tar.bz2
cmCustomCommandLine: Provide command line make functions
Reduce boilerplate necessary to create custom command lines by introducing and applying cmMakeCommandLine and cmMakeSingleCommandLine functions.
Diffstat (limited to 'Source/cmCustomCommandLines.cxx')
-rw-r--r--Source/cmCustomCommandLines.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmCustomCommandLines.cxx b/Source/cmCustomCommandLines.cxx
new file mode 100644
index 0000000..37ad75b
--- /dev/null
+++ b/Source/cmCustomCommandLines.cxx
@@ -0,0 +1,22 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmCustomCommandLines.h"
+
+cmCustomCommandLine cmMakeCommandLine(
+ std::initializer_list<cm::string_view> ilist)
+{
+ cmCustomCommandLine commandLine;
+ commandLine.reserve(ilist.size());
+ for (cm::string_view cmd : ilist) {
+ commandLine.emplace_back(cmd);
+ }
+ return commandLine;
+}
+
+cmCustomCommandLines cmMakeSingleCommandLine(
+ std::initializer_list<cm::string_view> ilist)
+{
+ cmCustomCommandLines commandLines;
+ commandLines.push_back(cmMakeCommandLine(ilist));
+ return commandLines;
+}