diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index f351ff80e2..a9be4452db 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -128,7 +128,7 @@ void GetScriptingCommands(cmState* state) cm::make_unique()); state->AddBuiltinCommand("execute_process", cm::make_unique()); - state->AddBuiltinCommand("file", cm::make_unique()); + state->AddBuiltinCommand("file", cmFileCommand); state->AddBuiltinCommand("find_file", cm::make_unique()); state->AddBuiltinCommand("find_library", cm::make_unique()); diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 652e3c5fa9..3292dc0d29 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2770,8 +2770,8 @@ bool HandleGetRuntimeDependenciesCommand(std::vector const& args, } // namespace -bool cmFileCommand::InitialPass(std::vector const& args, - cmExecutionStatus& status) +bool cmFileCommand(std::vector const& args, + cmExecutionStatus& status) { if (args.size() < 2) { status.SetError("must be called with at least two arguments."); diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index b5645400cd..8c9b21990a 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -8,33 +8,9 @@ #include #include -#include "cm_memory.hxx" - -#include "cmCommand.h" - class cmExecutionStatus; -/** \class cmFileCommand - * \brief Command for manipulation of files - * - */ -class cmFileCommand : public cmCommand -{ -public: - /** - * This is a virtual constructor for the command. - */ - std::unique_ptr Clone() override - { - return cm::make_unique(); - } - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ - bool InitialPass(std::vector const& args, - cmExecutionStatus& status) override; -}; +bool cmFileCommand(std::vector const& args, + cmExecutionStatus& status); #endif