mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-05 05:39:57 -05:00
cmCustomCommandLine: Provide command line make functions
Reduce boilerplate necessary to create custom command lines by introducing and applying cmMakeCommandLine and cmMakeSingleCommandLine functions.
This commit is contained in:
@@ -5,25 +5,28 @@
|
||||
|
||||
#include "cmConfigure.h" // IWYU pragma: keep
|
||||
|
||||
#include <initializer_list>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "cm_string_view.hxx" // IWYU pragma: keep
|
||||
|
||||
/** Data structure to represent a single command line. */
|
||||
class cmCustomCommandLine : public std::vector<std::string>
|
||||
{
|
||||
public:
|
||||
using Superclass = std::vector<std::string>;
|
||||
using iterator = Superclass::iterator;
|
||||
using const_iterator = Superclass::const_iterator;
|
||||
};
|
||||
|
||||
/** Data structure to represent a list of command lines. */
|
||||
class cmCustomCommandLines : public std::vector<cmCustomCommandLine>
|
||||
{
|
||||
public:
|
||||
using Superclass = std::vector<cmCustomCommandLine>;
|
||||
using iterator = Superclass::iterator;
|
||||
using const_iterator = Superclass::const_iterator;
|
||||
};
|
||||
|
||||
/** Return a command line from a list of command line parts. */
|
||||
cmCustomCommandLine cmMakeCommandLine(
|
||||
std::initializer_list<cm::string_view> ilist);
|
||||
|
||||
/** Return a command line vector with a single command line. */
|
||||
cmCustomCommandLines cmMakeSingleCommandLine(
|
||||
std::initializer_list<cm::string_view> ilist);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user