mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 04:40:56 -06:00
cmCommand refactor: cmExecProgramCommand
This commit is contained in:
@@ -8,43 +8,16 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "cm_memory.hxx"
|
||||
|
||||
#include "cmCommand.h"
|
||||
#include "cmProcessOutput.h"
|
||||
|
||||
class cmExecutionStatus;
|
||||
|
||||
/** \class cmExecProgramCommand
|
||||
/**
|
||||
* \brief Command that adds a target to the build system.
|
||||
*
|
||||
* cmExecProgramCommand adds an extra target to the build system.
|
||||
* This is useful when you would like to add special
|
||||
* targets like "install,", "clean," and so on.
|
||||
*/
|
||||
class cmExecProgramCommand : public cmCommand
|
||||
{
|
||||
public:
|
||||
typedef cmProcessOutput::Encoding Encoding;
|
||||
/**
|
||||
* This is a virtual constructor for the command.
|
||||
*/
|
||||
std::unique_ptr<cmCommand> Clone() override
|
||||
{
|
||||
return cm::make_unique<cmExecProgramCommand>();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called when the command is first encountered in
|
||||
* the CMakeLists.txt file.
|
||||
*/
|
||||
bool InitialPass(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status) override;
|
||||
|
||||
private:
|
||||
static bool RunCommand(std::string command, std::string& output, int& retVal,
|
||||
const char* directory = nullptr, bool verbose = true,
|
||||
Encoding encoding = cmProcessOutput::Auto);
|
||||
};
|
||||
bool cmExecProgramCommand(std::vector<std::string> const& args,
|
||||
cmExecutionStatus& status);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user