mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 12:16:40 +08:00
cmFileCommand: turn into free function
This commit is contained in:
@@ -128,7 +128,7 @@ void GetScriptingCommands(cmState* state)
|
|||||||
cm::make_unique<cmExecProgramCommand>());
|
cm::make_unique<cmExecProgramCommand>());
|
||||||
state->AddBuiltinCommand("execute_process",
|
state->AddBuiltinCommand("execute_process",
|
||||||
cm::make_unique<cmExecuteProcessCommand>());
|
cm::make_unique<cmExecuteProcessCommand>());
|
||||||
state->AddBuiltinCommand("file", cm::make_unique<cmFileCommand>());
|
state->AddBuiltinCommand("file", cmFileCommand);
|
||||||
state->AddBuiltinCommand("find_file", cm::make_unique<cmFindFileCommand>());
|
state->AddBuiltinCommand("find_file", cm::make_unique<cmFindFileCommand>());
|
||||||
state->AddBuiltinCommand("find_library",
|
state->AddBuiltinCommand("find_library",
|
||||||
cm::make_unique<cmFindLibraryCommand>());
|
cm::make_unique<cmFindLibraryCommand>());
|
||||||
|
@@ -2770,8 +2770,8 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args,
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
bool cmFileCommand::InitialPass(std::vector<std::string> const& args,
|
bool cmFileCommand(std::vector<std::string> const& args,
|
||||||
cmExecutionStatus& status)
|
cmExecutionStatus& status)
|
||||||
{
|
{
|
||||||
if (args.size() < 2) {
|
if (args.size() < 2) {
|
||||||
status.SetError("must be called with at least two arguments.");
|
status.SetError("must be called with at least two arguments.");
|
||||||
|
@@ -8,33 +8,9 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "cm_memory.hxx"
|
|
||||||
|
|
||||||
#include "cmCommand.h"
|
|
||||||
|
|
||||||
class cmExecutionStatus;
|
class cmExecutionStatus;
|
||||||
|
|
||||||
/** \class cmFileCommand
|
bool cmFileCommand(std::vector<std::string> const& args,
|
||||||
* \brief Command for manipulation of files
|
cmExecutionStatus& status);
|
||||||
*
|
|
||||||
*/
|
|
||||||
class cmFileCommand : public cmCommand
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* This is a virtual constructor for the command.
|
|
||||||
*/
|
|
||||||
std::unique_ptr<cmCommand> Clone() override
|
|
||||||
{
|
|
||||||
return cm::make_unique<cmFileCommand>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user