diff options
119 files changed, 268 insertions, 796 deletions
diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h index bfd4061..503ed23 100644 --- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h +++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.h @@ -42,14 +42,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE - { - return "ctest_empty_binary_directory"; - } }; #endif diff --git a/Source/CTest/cmCTestHandlerCommand.h b/Source/CTest/cmCTestHandlerCommand.h index adc1687..0ea0612 100644 --- a/Source/CTest/cmCTestHandlerCommand.h +++ b/Source/CTest/cmCTestHandlerCommand.h @@ -25,6 +25,11 @@ public: cmCTestHandlerCommand(); /** + * The name of the command as specified in CMakeList.txt. + */ + virtual std::string GetName() const = 0; + + /** * This is called when the command is first encountered in * the CMakeLists.txt file. */ diff --git a/Source/CTest/cmCTestMemCheckCommand.cxx b/Source/CTest/cmCTestMemCheckCommand.cxx index fd7c3a9..b9cae3b 100644 --- a/Source/CTest/cmCTestMemCheckCommand.cxx +++ b/Source/CTest/cmCTestMemCheckCommand.cxx @@ -3,6 +3,7 @@ #include "cmCTestMemCheckCommand.h" #include <sstream> +#include <string> #include <vector> #include "cmCTest.h" diff --git a/Source/CTest/cmCTestMemCheckCommand.h b/Source/CTest/cmCTestMemCheckCommand.h index fea65e8..fa59559 100644 --- a/Source/CTest/cmCTestMemCheckCommand.h +++ b/Source/CTest/cmCTestMemCheckCommand.h @@ -7,8 +7,6 @@ #include "cmCTestTestCommand.h" -#include <string> - class cmCTestGenericHandler; class cmCommand; @@ -33,11 +31,6 @@ public: return ni; } - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "ctest_memcheck"; } - protected: cmCTestGenericHandler* InitializeActualHandler() CM_OVERRIDE; diff --git a/Source/CTest/cmCTestReadCustomFilesCommand.h b/Source/CTest/cmCTestReadCustomFilesCommand.h index 04024ab..5989fa0 100644 --- a/Source/CTest/cmCTestReadCustomFilesCommand.h +++ b/Source/CTest/cmCTestReadCustomFilesCommand.h @@ -40,11 +40,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "ctest_read_custom_files"; } }; #endif diff --git a/Source/CTest/cmCTestRunScriptCommand.h b/Source/CTest/cmCTestRunScriptCommand.h index aac5114..9bd0965 100644 --- a/Source/CTest/cmCTestRunScriptCommand.h +++ b/Source/CTest/cmCTestRunScriptCommand.h @@ -41,11 +41,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "ctest_run_script"; } }; #endif diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 1fea8e5..1d29dfa 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -166,12 +166,12 @@ void cmCTestScriptHandler::UpdateElapsedTime() } } -void cmCTestScriptHandler::AddCTestCommand(cmCTestCommand* command) +void cmCTestScriptHandler::AddCTestCommand(std::string const& name, + cmCTestCommand* command) { - cmCTestCommand* newCom = command; - newCom->CTest = this->CTest; - newCom->CTestScriptHandler = this; - this->CMake->GetState()->AddCommand(newCom); + command->CTest = this->CTest; + command->CTestScriptHandler = this; + this->CMake->GetState()->AddBuiltinCommand(name, command); } int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) @@ -290,22 +290,21 @@ void cmCTestScriptHandler::CreateCMake() this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest); - // add any ctest specific commands, probably should have common superclass - // for ctest commands to clean this up. If a couple more commands are - // created with the same format lets do that - ken - this->AddCTestCommand(new cmCTestBuildCommand); - this->AddCTestCommand(new cmCTestConfigureCommand); - this->AddCTestCommand(new cmCTestCoverageCommand); - this->AddCTestCommand(new cmCTestEmptyBinaryDirectoryCommand); - this->AddCTestCommand(new cmCTestMemCheckCommand); - this->AddCTestCommand(new cmCTestReadCustomFilesCommand); - this->AddCTestCommand(new cmCTestRunScriptCommand); - this->AddCTestCommand(new cmCTestSleepCommand); - this->AddCTestCommand(new cmCTestStartCommand); - this->AddCTestCommand(new cmCTestSubmitCommand); - this->AddCTestCommand(new cmCTestTestCommand); - this->AddCTestCommand(new cmCTestUpdateCommand); - this->AddCTestCommand(new cmCTestUploadCommand); + this->AddCTestCommand("ctest_build", new cmCTestBuildCommand); + this->AddCTestCommand("ctest_configure", new cmCTestConfigureCommand); + this->AddCTestCommand("ctest_coverage", new cmCTestCoverageCommand); + this->AddCTestCommand("ctest_empty_binary_directory", + new cmCTestEmptyBinaryDirectoryCommand); + this->AddCTestCommand("ctest_memcheck", new cmCTestMemCheckCommand); + this->AddCTestCommand("ctest_read_custom_files", + new cmCTestReadCustomFilesCommand); + this->AddCTestCommand("ctest_run_script", new cmCTestRunScriptCommand); + this->AddCTestCommand("ctest_sleep", new cmCTestSleepCommand); + this->AddCTestCommand("ctest_start", new cmCTestStartCommand); + this->AddCTestCommand("ctest_submit", new cmCTestSubmitCommand); + this->AddCTestCommand("ctest_test", new cmCTestTestCommand); + this->AddCTestCommand("ctest_update", new cmCTestUpdateCommand); + this->AddCTestCommand("ctest_upload", new cmCTestUploadCommand); } // this sets up some variables for the script to use, creates the required diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index 3070796..6678702 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -126,7 +126,7 @@ private: int RunConfigurationDashboard(); // Add ctest command - void AddCTestCommand(cmCTestCommand* command); + void AddCTestCommand(std::string const& name, cmCTestCommand* command); // Try to remove the binary directory once static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath); diff --git a/Source/CTest/cmCTestSleepCommand.h b/Source/CTest/cmCTestSleepCommand.h index a55e9d9..f0b5f1e 100644 --- a/Source/CTest/cmCTestSleepCommand.h +++ b/Source/CTest/cmCTestSleepCommand.h @@ -41,11 +41,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "ctest_sleep"; } }; #endif diff --git a/Source/CTest/cmCTestStartCommand.h b/Source/CTest/cmCTestStartCommand.h index 26a63fb..b4943f9 100644 --- a/Source/CTest/cmCTestStartCommand.h +++ b/Source/CTest/cmCTestStartCommand.h @@ -54,11 +54,6 @@ public: */ bool ShouldBeQuiet() { return this->Quiet; } - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "ctest_start"; } - private: bool InitialCheckout(std::ostream& ofs, std::string const& sourceDir); bool CreateNewTag; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 349e91a..da3ae2f 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -56,11 +56,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& /*unused*/) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "subdirs"; } - cmCTestTestHandler* TestHandler; }; @@ -136,11 +131,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& /*unused*/) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_subdirectory"; } - cmCTestTestHandler* TestHandler; }; @@ -206,11 +196,6 @@ public: bool InitialPass(std::vector<std::string> const& /*args*/, cmExecutionStatus& /*unused*/) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_test"; } - cmCTestTestHandler* TestHandler; }; @@ -244,11 +229,6 @@ public: bool InitialPass(std::vector<std::string> const& /*args*/, cmExecutionStatus& /*unused*/) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "set_tests_properties"; } - cmCTestTestHandler* TestHandler; }; @@ -1662,23 +1642,23 @@ void cmCTestTestHandler::GetListOfTests() // Add handler for ADD_TEST cmCTestAddTestCommand* newCom1 = new cmCTestAddTestCommand; newCom1->TestHandler = this; - cm.GetState()->AddCommand(newCom1); + cm.GetState()->AddBuiltinCommand("add_test", newCom1); // Add handler for SUBDIRS cmCTestSubdirCommand* newCom2 = new cmCTestSubdirCommand; newCom2->TestHandler = this; - cm.GetState()->AddCommand(newCom2); + cm.GetState()->AddBuiltinCommand("subdirs", newCom2); // Add handler for ADD_SUBDIRECTORY cmCTestAddSubdirectoryCommand* newCom3 = new cmCTestAddSubdirectoryCommand; newCom3->TestHandler = this; - cm.GetState()->AddCommand(newCom3); + cm.GetState()->AddBuiltinCommand("add_subdirectory", newCom3); - // Add handler for SET_SOURCE_FILES_PROPERTIES + // Add handler for SET_TESTS_PROPERTIES cmCTestSetTestsPropertiesCommand* newCom4 = new cmCTestSetTestsPropertiesCommand; newCom4->TestHandler = this; - cm.GetState()->AddCommand(newCom4); + cm.GetState()->AddBuiltinCommand("set_tests_properties", newCom4); const char* testFilename; if (cmSystemTools::FileExists("CTestTestfile.cmake")) { diff --git a/Source/cmAddCompileOptionsCommand.h b/Source/cmAddCompileOptionsCommand.h index 105d323..297f901 100644 --- a/Source/cmAddCompileOptionsCommand.h +++ b/Source/cmAddCompileOptionsCommand.h @@ -26,11 +26,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_compile_options"; } }; #endif diff --git a/Source/cmAddCustomCommandCommand.h b/Source/cmAddCustomCommandCommand.h index 912a91a..c3a91b2 100644 --- a/Source/cmAddCustomCommandCommand.h +++ b/Source/cmAddCustomCommandCommand.h @@ -33,11 +33,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_custom_command"; } - protected: bool CheckOutputs(const std::vector<std::string>& outputs); }; diff --git a/Source/cmAddCustomTargetCommand.h b/Source/cmAddCustomTargetCommand.h index c449b10..7229c27 100644 --- a/Source/cmAddCustomTargetCommand.h +++ b/Source/cmAddCustomTargetCommand.h @@ -33,11 +33,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_custom_target"; } }; #endif diff --git a/Source/cmAddDefinitionsCommand.h b/Source/cmAddDefinitionsCommand.h index de4bc1c..abf5a59 100644 --- a/Source/cmAddDefinitionsCommand.h +++ b/Source/cmAddDefinitionsCommand.h @@ -32,11 +32,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_definitions"; } }; #endif diff --git a/Source/cmAddDependenciesCommand.h b/Source/cmAddDependenciesCommand.h index 88ac336..c7328d6 100644 --- a/Source/cmAddDependenciesCommand.h +++ b/Source/cmAddDependenciesCommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_dependencies"; } }; #endif diff --git a/Source/cmAddExecutableCommand.h b/Source/cmAddExecutableCommand.h index 6531829..8100da1 100644 --- a/Source/cmAddExecutableCommand.h +++ b/Source/cmAddExecutableCommand.h @@ -32,11 +32,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_executable"; } }; #endif diff --git a/Source/cmAddLibraryCommand.h b/Source/cmAddLibraryCommand.h index 977645e..df49fae 100644 --- a/Source/cmAddLibraryCommand.h +++ b/Source/cmAddLibraryCommand.h @@ -32,11 +32,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_library"; } }; #endif diff --git a/Source/cmAddSubDirectoryCommand.h b/Source/cmAddSubDirectoryCommand.h index b19477a..0e71ffd 100644 --- a/Source/cmAddSubDirectoryCommand.h +++ b/Source/cmAddSubDirectoryCommand.h @@ -33,11 +33,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_subdirectory"; } }; #endif diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h index 1d6c4cc..a098a03 100644 --- a/Source/cmAddTestCommand.h +++ b/Source/cmAddTestCommand.h @@ -32,11 +32,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "add_test"; } - private: bool HandleNameMode(std::vector<std::string> const& args); }; diff --git a/Source/cmAuxSourceDirectoryCommand.h b/Source/cmAuxSourceDirectoryCommand.h index f8800a5..e49e861 100644 --- a/Source/cmAuxSourceDirectoryCommand.h +++ b/Source/cmAuxSourceDirectoryCommand.h @@ -35,11 +35,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "aux_source_directory"; } }; #endif diff --git a/Source/cmBreakCommand.h b/Source/cmBreakCommand.h index 0038883..fcca45c 100644 --- a/Source/cmBreakCommand.h +++ b/Source/cmBreakCommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "break"; } }; #endif diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h index 7df54ec..1f357a9 100644 --- a/Source/cmBuildCommand.h +++ b/Source/cmBuildCommand.h @@ -42,11 +42,6 @@ public: */ virtual bool TwoArgsSignature(std::vector<std::string> const& args); - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "build_command"; } - private: bool IgnoreErrors() const; }; diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h index 9008c27..ff26c55 100644 --- a/Source/cmBuildNameCommand.h +++ b/Source/cmBuildNameCommand.h @@ -18,7 +18,6 @@ public: cmCommand* Clone() CM_OVERRIDE { return new cmBuildNameCommand; } bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - std::string GetName() const CM_OVERRIDE { return "build_name"; } }; #endif diff --git a/Source/cmCMakeHostSystemInformationCommand.h b/Source/cmCMakeHostSystemInformationCommand.h index 4263e75..ef6ca37 100644 --- a/Source/cmCMakeHostSystemInformationCommand.h +++ b/Source/cmCMakeHostSystemInformationCommand.h @@ -40,14 +40,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE - { - return "cmake_host_system_information"; - } - private: bool GetValue(cmsys::SystemInformation& info, std::string const& key, std::string& value); diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h index d264675..45b6b78 100644 --- a/Source/cmCMakeMinimumRequired.h +++ b/Source/cmCMakeMinimumRequired.h @@ -32,11 +32,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "cmake_minimum_required"; } - private: std::vector<std::string> UnknownArguments; bool EnforceUnknownArguments(); diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h index cc02169..0e88243 100644 --- a/Source/cmCMakePolicyCommand.h +++ b/Source/cmCMakePolicyCommand.h @@ -33,11 +33,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "cmake_policy"; } - private: bool HandleSetMode(std::vector<std::string> const& args); bool HandleGetMode(std::vector<std::string> const& args); diff --git a/Source/cmCommand.h b/Source/cmCommand.h index 2e2ba43..ad72fe2 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -80,17 +80,6 @@ public: virtual cmCommand* Clone() = 0; /** - * This determines if the command is defined in a cmake script. - * It is the case for cmMacroHelperCommand and cmFunctionHelperCommand. - */ - virtual bool IsUserDefined() const { return false; } - - /** - * The name of the command as specified in CMakeList.txt. - */ - virtual std::string GetName() const = 0; - - /** * Return the last error string. */ const char* GetError(); diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index adf46ff..e1d8ef1 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -70,7 +70,6 @@ #include "cmTargetLinkLibrariesCommand.h" #include "cmTryCompileCommand.h" #include "cmTryRunCommand.h" -#include "cmUnexpectedCommand.h" #include "cmUnsetCommand.h" #include "cmWhileCommand.h" @@ -79,7 +78,6 @@ #include "cmAuxSourceDirectoryCommand.h" #include "cmBuildNameCommand.h" #include "cmCMakeHostSystemInformationCommand.h" -#include "cmDisallowedCommand.h" #include "cmExportCommand.h" #include "cmExportLibraryDependenciesCommand.h" #include "cmFLTKWrapUICommand.h" @@ -109,169 +107,195 @@ void GetScriptingCommands(cmState* state) { - state->AddCommand(new cmBreakCommand); - state->AddCommand(new cmCMakeMinimumRequired); - state->AddCommand(new cmCMakePolicyCommand); - state->AddCommand(new cmConfigureFileCommand); - state->AddCommand(new cmContinueCommand); - state->AddCommand(new cmExecProgramCommand); - state->AddCommand(new cmExecuteProcessCommand); - state->AddCommand(new cmFileCommand); - state->AddCommand(new cmFindFileCommand); - state->AddCommand(new cmFindLibraryCommand); - state->AddCommand(new cmFindPackageCommand); - state->AddCommand(new cmFindPathCommand); - state->AddCommand(new cmFindProgramCommand); - state->AddCommand(new cmForEachCommand); - state->AddCommand(new cmFunctionCommand); - state->AddCommand(new cmGetCMakePropertyCommand); - state->AddCommand(new cmGetDirectoryPropertyCommand); - state->AddCommand(new cmGetFilenameComponentCommand); - state->AddCommand(new cmGetPropertyCommand); - state->AddCommand(new cmIfCommand); - state->AddCommand(new cmIncludeCommand); - state->AddCommand(new cmListCommand); - state->AddCommand(new cmMacroCommand); - state->AddCommand(new cmMakeDirectoryCommand); - state->AddCommand(new cmMarkAsAdvancedCommand); - state->AddCommand(new cmMathCommand); - state->AddCommand(new cmMessageCommand); - state->AddCommand(new cmOptionCommand); - state->AddCommand(new cmParseArgumentsCommand); - state->AddCommand(new cmReturnCommand); - state->AddCommand(new cmSeparateArgumentsCommand); - state->AddCommand(new cmSetCommand); - state->AddCommand(new cmSetDirectoryPropertiesCommand); - state->AddCommand(new cmSetPropertyCommand); - state->AddCommand(new cmSiteNameCommand); - state->AddCommand(new cmStringCommand); - state->AddCommand(new cmUnsetCommand); - state->AddCommand(new cmWhileCommand); + state->AddBuiltinCommand("break", new cmBreakCommand); + state->AddBuiltinCommand("cmake_minimum_required", + new cmCMakeMinimumRequired); + state->AddBuiltinCommand("cmake_policy", new cmCMakePolicyCommand); + state->AddBuiltinCommand("configure_file", new cmConfigureFileCommand); + state->AddBuiltinCommand("continue", new cmContinueCommand); + state->AddBuiltinCommand("exec_program", new cmExecProgramCommand); + state->AddBuiltinCommand("execute_process", new cmExecuteProcessCommand); + state->AddBuiltinCommand("file", new cmFileCommand); + state->AddBuiltinCommand("find_file", new cmFindFileCommand); + state->AddBuiltinCommand("find_library", new cmFindLibraryCommand); + state->AddBuiltinCommand("find_package", new cmFindPackageCommand); + state->AddBuiltinCommand("find_path", new cmFindPathCommand); + state->AddBuiltinCommand("find_program", new cmFindProgramCommand); + state->AddBuiltinCommand("foreach", new cmForEachCommand); + state->AddBuiltinCommand("function", new cmFunctionCommand); + state->AddBuiltinCommand("get_cmake_property", + new cmGetCMakePropertyCommand); + state->AddBuiltinCommand("get_directory_property", + new cmGetDirectoryPropertyCommand); + state->AddBuiltinCommand("get_filename_component", + new cmGetFilenameComponentCommand); + state->AddBuiltinCommand("get_property", new cmGetPropertyCommand); + state->AddBuiltinCommand("if", new cmIfCommand); + state->AddBuiltinCommand("include", new cmIncludeCommand); + state->AddBuiltinCommand("list", new cmListCommand); + state->AddBuiltinCommand("macro", new cmMacroCommand); + state->AddBuiltinCommand("make_directory", new cmMakeDirectoryCommand); + state->AddBuiltinCommand("mark_as_advanced", new cmMarkAsAdvancedCommand); + state->AddBuiltinCommand("math", new cmMathCommand); + state->AddBuiltinCommand("message", new cmMessageCommand); + state->AddBuiltinCommand("option", new cmOptionCommand); + state->AddBuiltinCommand("cmake_parse_arguments", + new cmParseArgumentsCommand); + state->AddBuiltinCommand("return", new cmReturnCommand); + state->AddBuiltinCommand("separate_arguments", + new cmSeparateArgumentsCommand); + state->AddBuiltinCommand("set", new cmSetCommand); + state->AddBuiltinCommand("set_directory_properties", + new cmSetDirectoryPropertiesCommand); + state->AddBuiltinCommand("set_property", new cmSetPropertyCommand); + state->AddBuiltinCommand("site_name", new cmSiteNameCommand); + state->AddBuiltinCommand("string", new cmStringCommand); + state->AddBuiltinCommand("unset", new cmUnsetCommand); + state->AddBuiltinCommand("while", new cmWhileCommand); - state->AddCommand(new cmUnexpectedCommand( + state->AddUnexpectedCommand( "else", "An ELSE command was found outside of a proper " "IF ENDIF structure. Or its arguments did not match " - "the opening IF command.")); - state->AddCommand(new cmUnexpectedCommand( + "the opening IF command."); + state->AddUnexpectedCommand( "elseif", "An ELSEIF command was found outside of a proper " - "IF ENDIF structure.")); - state->AddCommand(new cmUnexpectedCommand( + "IF ENDIF structure."); + state->AddUnexpectedCommand( "endforeach", "An ENDFOREACH command was found outside of a proper " "FOREACH ENDFOREACH structure. Or its arguments did " - "not match the opening FOREACH command.")); - state->AddCommand(new cmUnexpectedCommand( + "not match the opening FOREACH command."); + state->AddUnexpectedCommand( "endfunction", "An ENDFUNCTION command was found outside of a proper " "FUNCTION ENDFUNCTION structure. Or its arguments did not " - "match the opening FUNCTION command.")); - state->AddCommand(new cmUnexpectedCommand( + "match the opening FUNCTION command."); + state->AddUnexpectedCommand( "endif", "An ENDIF command was found outside of a proper " "IF ENDIF structure. Or its arguments did not match " - "the opening IF command.")); - state->AddCommand(new cmUnexpectedCommand( + "the opening IF command."); + state->AddUnexpectedCommand( "endmacro", "An ENDMACRO command was found outside of a proper " "MACRO ENDMACRO structure. Or its arguments did not " - "match the opening MACRO command.")); - state->AddCommand(new cmUnexpectedCommand( + "match the opening MACRO command."); + state->AddUnexpectedCommand( "endwhile", "An ENDWHILE command was found outside of a proper " "WHILE ENDWHILE structure. Or its arguments did not " - "match the opening WHILE command.")); + "match the opening WHILE command."); #if defined(CMAKE_BUILD_WITH_CMAKE) - state->AddCommand(new cmCMakeHostSystemInformationCommand); - state->AddCommand(new cmRemoveCommand); - state->AddCommand(new cmVariableWatchCommand); - state->AddCommand(new cmWriteFileCommand); + state->AddBuiltinCommand("cmake_host_system_information", + new cmCMakeHostSystemInformationCommand); + state->AddBuiltinCommand("remove", new cmRemoveCommand); + state->AddBuiltinCommand("variable_watch", new cmVariableWatchCommand); + state->AddBuiltinCommand("write_file", new cmWriteFileCommand); - state->AddCommand(new cmDisallowedCommand( - new cmBuildNameCommand, cmPolicies::CMP0036, - "The build_name command should not be called; see CMP0036.")); - state->AddCommand(new cmDisallowedCommand( - new cmUseMangledMesaCommand, cmPolicies::CMP0030, - "The use_mangled_mesa command should not be called; see CMP0030.")); + state->AddDisallowedCommand( + "build_name", new cmBuildNameCommand, cmPolicies::CMP0036, + "The build_name command should not be called; see CMP0036."); + state->AddDisallowedCommand( + "use_mangled_mesa", new cmUseMangledMesaCommand, cmPolicies::CMP0030, + "The use_mangled_mesa command should not be called; see CMP0030."); #endif } void GetProjectCommands(cmState* state) { - state->AddCommand(new cmAddCustomCommandCommand); - state->AddCommand(new cmAddCustomTargetCommand); - state->AddCommand(new cmAddDefinitionsCommand); - state->AddCommand(new cmAddDependenciesCommand); - state->AddCommand(new cmAddExecutableCommand); - state->AddCommand(new cmAddLibraryCommand); - state->AddCommand(new cmAddSubDirectoryCommand); - state->AddCommand(new cmAddTestCommand); - state->AddCommand(new cmBuildCommand); - state->AddCommand(new cmCreateTestSourceList); - state->AddCommand(new cmDefinePropertyCommand); - state->AddCommand(new cmEnableLanguageCommand); - state->AddCommand(new cmEnableTestingCommand); - state->AddCommand(new cmGetSourceFilePropertyCommand); - state->AddCommand(new cmGetTargetPropertyCommand); - state->AddCommand(new cmGetTestPropertyCommand); - state->AddCommand(new cmIncludeDirectoryCommand); - state->AddCommand(new cmIncludeRegularExpressionCommand); - state->AddCommand(new cmInstallCommand); - state->AddCommand(new cmInstallFilesCommand); - state->AddCommand(new cmInstallTargetsCommand); - state->AddCommand(new cmLinkDirectoriesCommand); - state->AddCommand(new cmProjectCommand); - state->AddCommand(new cmSetSourceFilesPropertiesCommand); - state->AddCommand(new cmSetTargetPropertiesCommand); - state->AddCommand(new cmSetTestsPropertiesCommand); - state->AddCommand(new cmSubdirCommand); - state->AddCommand(new cmTargetLinkLibrariesCommand); - state->AddCommand(new cmTryCompileCommand); - state->AddCommand(new cmTryRunCommand); + state->AddBuiltinCommand("add_custom_command", + new cmAddCustomCommandCommand); + state->AddBuiltinCommand("add_custom_target", new cmAddCustomTargetCommand); + state->AddBuiltinCommand("add_definitions", new cmAddDefinitionsCommand); + state->AddBuiltinCommand("add_dependencies", new cmAddDependenciesCommand); + state->AddBuiltinCommand("add_executable", new cmAddExecutableCommand); + state->AddBuiltinCommand("add_library", new cmAddLibraryCommand); + state->AddBuiltinCommand("add_subdirectory", new cmAddSubDirectoryCommand); + state->AddBuiltinCommand("add_test", new cmAddTestCommand); + state->AddBuiltinCommand("build_command", new cmBuildCommand); + state->AddBuiltinCommand("create_test_sourcelist", + new cmCreateTestSourceList); + state->AddBuiltinCommand("define_property", new cmDefinePropertyCommand); + state->AddBuiltinCommand("enable_language", new cmEnableLanguageCommand); + state->AddBuiltinCommand("enable_testing", new cmEnableTestingCommand); + state->AddBuiltinCommand("get_source_file_property", + new cmGetSourceFilePropertyCommand); + state->AddBuiltinCommand("get_target_property", + new cmGetTargetPropertyCommand); + state->AddBuiltinCommand("get_test_property", new cmGetTestPropertyCommand); + state->AddBuiltinCommand("include_directories", + new cmIncludeDirectoryCommand); + state->AddBuiltinCommand("include_regular_expression", + new cmIncludeRegularExpressionCommand); + state->AddBuiltinCommand("install", new cmInstallCommand); + state->AddBuiltinCommand("install_files", new cmInstallFilesCommand); + state->AddBuiltinCommand("install_targets", new cmInstallTargetsCommand); + state->AddBuiltinCommand("link_directories", new cmLinkDirectoriesCommand); + state->AddBuiltinCommand("project", new cmProjectCommand); + state->AddBuiltinCommand("set_source_files_properties", + new cmSetSourceFilesPropertiesCommand); + state->AddBuiltinCommand("set_target_properties", + new cmSetTargetPropertiesCommand); + state->AddBuiltinCommand("set_tests_properties", + new cmSetTestsPropertiesCommand); + state->AddBuiltinCommand("subdirs", new cmSubdirCommand); + state->AddBuiltinCommand("target_link_libraries", + new cmTargetLinkLibrariesCommand); + state->AddBuiltinCommand("try_compile", new cmTryCompileCommand); + state->AddBuiltinCommand("try_run", new cmTryRunCommand); #if defined(CMAKE_BUILD_WITH_CMAKE) - state->AddCommand(new cmAddCompileOptionsCommand); - state->AddCommand(new cmAuxSourceDirectoryCommand); - state->AddCommand(new cmExportCommand); - state->AddCommand(new cmFLTKWrapUICommand); - state->AddCommand(new cmIncludeExternalMSProjectCommand); - state->AddCommand(new cmInstallProgramsCommand); - state->AddCommand(new cmLinkLibrariesCommand); - state->AddCommand(new cmLoadCacheCommand); - state->AddCommand(new cmQTWrapCPPCommand); - state->AddCommand(new cmQTWrapUICommand); - state->AddCommand(new cmRemoveDefinitionsCommand); - state->AddCommand(new cmSourceGroupCommand); - state->AddCommand(new cmTargetCompileDefinitionsCommand); - state->AddCommand(new cmTargetCompileFeaturesCommand); - state->AddCommand(new cmTargetCompileOptionsCommand); - state->AddCommand(new cmTargetIncludeDirectoriesCommand); - state->AddCommand(new cmTargetSourcesCommand); + state->AddBuiltinCommand("add_compile_options", + new cmAddCompileOptionsCommand); + state->AddBuiltinCommand("aux_source_directory", + new cmAuxSourceDirectoryCommand); + state->AddBuiltinCommand("export", new cmExportCommand); + state->AddBuiltinCommand("fltk_wrap_ui", new cmFLTKWrapUICommand); + state->AddBuiltinCommand("include_external_msproject", + new cmIncludeExternalMSProjectCommand); + state->AddBuiltinCommand("install_programs", new cmInstallProgramsCommand); + state->AddBuiltinCommand("link_libraries", new cmLinkLibrariesCommand); + state->AddBuiltinCommand("load_cache", new cmLoadCacheCommand); + state->AddBuiltinCommand("qt_wrap_cpp", new cmQTWrapCPPCommand); + state->AddBuiltinCommand("qt_wrap_ui", new cmQTWrapUICommand); + state->AddBuiltinCommand("remove_definitions", + new cmRemoveDefinitionsCommand); + state->AddBuiltinCommand("source_group", new cmSourceGroupCommand); + state->AddBuiltinCommand("target_compile_definitions", + new cmTargetCompileDefinitionsCommand); + state->AddBuiltinCommand("target_compile_features", + new cmTargetCompileFeaturesCommand); + state->AddBuiltinCommand("target_compile_options", + new cmTargetCompileOptionsCommand); + state->AddBuiltinCommand("target_include_directories", + new cmTargetIncludeDirectoriesCommand); + state->AddBuiltinCommand("target_sources", new cmTargetSourcesCommand); - state->AddCommand(new cmDisallowedCommand( - new cmExportLibraryDependenciesCommand, cmPolicies::CMP0033, + state->AddDisallowedCommand( + "export_library_dependencies", new cmExportLibraryDependenciesCommand, + cmPolicies::CMP0033, "The export_library_dependencies command should not be called; " - "see CMP0033.")); - state->AddCommand(new cmDisallowedCommand( - new cmLoadCommandCommand, cmPolicies::CMP0031, - "The load_command command should not be called; see CMP0031.")); - state->AddCommand(new cmDisallowedCommand( - new cmOutputRequiredFilesCommand, cmPolicies::CMP0032, - "The output_required_files command should not be called; " - "see CMP0032.")); - state->AddCommand(new cmDisallowedCommand( - new cmSubdirDependsCommand, cmPolicies::CMP0029, - "The subdir_depends command should not be called; see CMP0029.")); - state->AddCommand(new cmDisallowedCommand( - new cmUtilitySourceCommand, cmPolicies::CMP0034, - "The utility_source command should not be called; see CMP0034.")); - state->AddCommand(new cmDisallowedCommand( - new cmVariableRequiresCommand, cmPolicies::CMP0035, - "The variable_requires command should not be called; see CMP0035.")); + "see CMP0033."); + state->AddDisallowedCommand( + "load_command", new cmLoadCommandCommand, cmPolicies::CMP0031, + "The load_command command should not be called; see CMP0031."); + state->AddDisallowedCommand( + "output_required_files", new cmOutputRequiredFilesCommand, + cmPolicies::CMP0032, + "The output_required_files command should not be called; see CMP0032."); + state->AddDisallowedCommand( + "subdir_depends", new cmSubdirDependsCommand, cmPolicies::CMP0029, + "The subdir_depends command should not be called; see CMP0029."); + state->AddDisallowedCommand( + "utility_source", new cmUtilitySourceCommand, cmPolicies::CMP0034, + "The utility_source command should not be called; see CMP0034."); + state->AddDisallowedCommand( + "variable_requires", new cmVariableRequiresCommand, cmPolicies::CMP0035, + "The variable_requires command should not be called; see CMP0035."); #endif } void GetProjectCommandsInScriptMode(cmState* state) { #define CM_UNEXPECTED_PROJECT_COMMAND(NAME) \ - state->AddCommand(new cmUnexpectedCommand(NAME, "command is not " \ - "scriptable")) + state->AddUnexpectedCommand(NAME, "command is not scriptable") CM_UNEXPECTED_PROJECT_COMMAND("add_compile_options"); CM_UNEXPECTED_PROJECT_COMMAND("add_custom_command"); diff --git a/Source/cmConfigureFileCommand.h b/Source/cmConfigureFileCommand.h index 402423d..6cebbd2 100644 --- a/Source/cmConfigureFileCommand.h +++ b/Source/cmConfigureFileCommand.h @@ -25,11 +25,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "configure_file"; } - private: int ConfigureFile(); diff --git a/Source/cmContinueCommand.h b/Source/cmContinueCommand.h index 4b416a4..92bc68e 100644 --- a/Source/cmContinueCommand.h +++ b/Source/cmContinueCommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "continue"; } }; #endif diff --git a/Source/cmCreateTestSourceList.h b/Source/cmCreateTestSourceList.h index 47391f3..f1f1e4b 100644 --- a/Source/cmCreateTestSourceList.h +++ b/Source/cmCreateTestSourceList.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "create_test_sourcelist"; } }; #endif diff --git a/Source/cmDefinePropertyCommand.h b/Source/cmDefinePropertyCommand.h index 7a6e127..bc120c5 100644 --- a/Source/cmDefinePropertyCommand.h +++ b/Source/cmDefinePropertyCommand.h @@ -24,11 +24,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "define_property"; } - private: std::string PropertyName; std::string BriefDocs; diff --git a/Source/cmDisallowedCommand.h b/Source/cmDisallowedCommand.h index 38d1d93..0030116 100644 --- a/Source/cmDisallowedCommand.h +++ b/Source/cmDisallowedCommand.h @@ -42,8 +42,6 @@ public: return this->Command->HasFinalPass(); } - std::string GetName() const CM_OVERRIDE { return this->Command->GetName(); } - private: cmCommand* Command; cmPolicies::PolicyID Policy; diff --git a/Source/cmEnableLanguageCommand.h b/Source/cmEnableLanguageCommand.h index 0748283..33c1c22 100644 --- a/Source/cmEnableLanguageCommand.h +++ b/Source/cmEnableLanguageCommand.h @@ -34,11 +34,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "enable_language"; } }; #endif diff --git a/Source/cmEnableTestingCommand.h b/Source/cmEnableTestingCommand.h index b4ac068..e249662 100644 --- a/Source/cmEnableTestingCommand.h +++ b/Source/cmEnableTestingCommand.h @@ -39,11 +39,6 @@ public: */ bool InitialPass(std::vector<std::string> const&, cmExecutionStatus&) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "enable_testing"; } }; #endif diff --git a/Source/cmExecProgramCommand.h b/Source/cmExecProgramCommand.h index 2a59612..6463c4d 100644 --- a/Source/cmExecProgramCommand.h +++ b/Source/cmExecProgramCommand.h @@ -36,11 +36,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "exec_program"; } - private: static bool RunCommand(const char* command, std::string& output, int& retVal, const char* directory = CM_NULLPTR, diff --git a/Source/cmExecuteProcessCommand.h b/Source/cmExecuteProcessCommand.h index e57e22d..08fde0a 100644 --- a/Source/cmExecuteProcessCommand.h +++ b/Source/cmExecuteProcessCommand.h @@ -32,11 +32,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "execute_process"; } }; #endif diff --git a/Source/cmExportCommand.h b/Source/cmExportCommand.h index b95ea86..c47bc42 100644 --- a/Source/cmExportCommand.h +++ b/Source/cmExportCommand.h @@ -36,11 +36,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "export"; } - private: cmCommandArgumentsHelper Helper; cmCommandArgumentGroup ArgumentGroup; diff --git a/Source/cmExportLibraryDependenciesCommand.h b/Source/cmExportLibraryDependenciesCommand.h index 4d3e36e..5559af9 100644 --- a/Source/cmExportLibraryDependenciesCommand.h +++ b/Source/cmExportLibraryDependenciesCommand.h @@ -21,10 +21,6 @@ public: } bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - std::string GetName() const CM_OVERRIDE - { - return "export_library_dependencies"; - } void FinalPass() CM_OVERRIDE; bool HasFinalPass() const CM_OVERRIDE { return true; } diff --git a/Source/cmFLTKWrapUICommand.h b/Source/cmFLTKWrapUICommand.h index 7dde9c1..d8045ab 100644 --- a/Source/cmFLTKWrapUICommand.h +++ b/Source/cmFLTKWrapUICommand.h @@ -43,11 +43,6 @@ public: void FinalPass() CM_OVERRIDE; bool HasFinalPass() const CM_OVERRIDE { return true; } - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "fltk_wrap_ui"; } - private: /** * List of produced files. diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h index ff0b35e..d09ef42 100644 --- a/Source/cmFileCommand.h +++ b/Source/cmFileCommand.h @@ -31,11 +31,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "file"; } - protected: bool HandleRename(std::vector<std::string> const& args); bool HandleRemove(std::vector<std::string> const& args, bool recurse); diff --git a/Source/cmFindFileCommand.h b/Source/cmFindFileCommand.h index 489df65..bf57fec 100644 --- a/Source/cmFindFileCommand.h +++ b/Source/cmFindFileCommand.h @@ -5,8 +5,6 @@ #include "cmConfigure.h" -#include <string> - #include "cmFindPathCommand.h" class cmCommand; @@ -27,7 +25,6 @@ public: * This is a virtual constructor for the command. */ cmCommand* Clone() CM_OVERRIDE { return new cmFindFileCommand; } - std::string GetName() const CM_OVERRIDE { return "find_file"; } }; #endif diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h index 41af976..9d38eab 100644 --- a/Source/cmFindLibraryCommand.h +++ b/Source/cmFindLibraryCommand.h @@ -36,11 +36,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "find_library"; } - protected: void AddArchitecturePaths(const char* suffix); void AddArchitecturePath(std::string const& dir, diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index e4ecfad..318b1dc 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -60,11 +60,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "find_package"; } - private: class PathLabel : public cmFindCommon::PathLabel { diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h index 92849c3..3761145 100644 --- a/Source/cmFindPathCommand.h +++ b/Source/cmFindPathCommand.h @@ -36,11 +36,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "find_path"; } - bool IncludeFileInPath; private: diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h index af56aef..a0d6af9 100644 --- a/Source/cmFindProgramCommand.h +++ b/Source/cmFindProgramCommand.h @@ -37,11 +37,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "find_program"; } - private: std::string FindProgram(); std::string FindNormalProgram(); diff --git a/Source/cmForEachCommand.h b/Source/cmForEachCommand.h index 30f0342..7c8a6d8 100644 --- a/Source/cmForEachCommand.h +++ b/Source/cmForEachCommand.h @@ -48,11 +48,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "foreach"; } - private: bool HandleInMode(std::vector<std::string> const& args); }; diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index dccc29f..ee52bde 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -21,11 +21,6 @@ public: ~cmFunctionHelperCommand() CM_OVERRIDE {} /** - * This determines if the command is defined in a cmake script. - */ - bool IsUserDefined() const CM_OVERRIDE { return true; } - - /** * This is a virtual constructor for the command. */ cmCommand* Clone() CM_OVERRIDE @@ -52,11 +47,6 @@ public: return false; } - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return this->Args[0]; } - std::vector<std::string> Args; std::vector<cmListFileFunction> Functions; cmPolicies::PolicyMap Policies; @@ -149,11 +139,7 @@ bool cmFunctionFunctionBlocker::IsFunctionBlocked( f->Functions = this->Functions; f->FilePath = this->GetStartingContext().FilePath; mf.RecordPolicies(f->Policies); - - std::string newName = "_" + this->Args[0]; - mf.GetState()->RenameCommand(this->Args[0], newName); - mf.GetState()->AddCommand(f); - + mf.GetState()->AddScriptedCommand(this->Args[0], f); // remove the function blocker now that the function is defined mf.RemoveFunctionBlocker(this, lff); return true; diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h index fa13aa4..f263126 100644 --- a/Source/cmFunctionCommand.h +++ b/Source/cmFunctionCommand.h @@ -44,11 +44,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "function"; } }; #endif diff --git a/Source/cmGetCMakePropertyCommand.h b/Source/cmGetCMakePropertyCommand.h index b0ddb22..9dfc40f 100644 --- a/Source/cmGetCMakePropertyCommand.h +++ b/Source/cmGetCMakePropertyCommand.h @@ -23,11 +23,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "get_cmake_property"; } }; #endif diff --git a/Source/cmGetDirectoryPropertyCommand.h b/Source/cmGetDirectoryPropertyCommand.h index f91a466..7d97950 100644 --- a/Source/cmGetDirectoryPropertyCommand.h +++ b/Source/cmGetDirectoryPropertyCommand.h @@ -24,11 +24,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "get_directory_property"; } - private: void StoreResult(const std::string& variable, const char* prop); }; diff --git a/Source/cmGetFilenameComponentCommand.h b/Source/cmGetFilenameComponentCommand.h index cf64564..c8a23c7 100644 --- a/Source/cmGetFilenameComponentCommand.h +++ b/Source/cmGetFilenameComponentCommand.h @@ -32,11 +32,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "get_filename_component"; } }; #endif diff --git a/Source/cmGetPropertyCommand.h b/Source/cmGetPropertyCommand.h index 7bbcec0..6497801 100644 --- a/Source/cmGetPropertyCommand.h +++ b/Source/cmGetPropertyCommand.h @@ -26,11 +26,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "get_property"; } - private: enum OutType { diff --git a/Source/cmGetSourceFilePropertyCommand.h b/Source/cmGetSourceFilePropertyCommand.h index 558e2ab..e96bb29 100644 --- a/Source/cmGetSourceFilePropertyCommand.h +++ b/Source/cmGetSourceFilePropertyCommand.h @@ -23,14 +23,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE - { - return "get_source_file_property"; - } }; #endif diff --git a/Source/cmGetTargetPropertyCommand.h b/Source/cmGetTargetPropertyCommand.h index 9cebb3b..5de3225 100644 --- a/Source/cmGetTargetPropertyCommand.h +++ b/Source/cmGetTargetPropertyCommand.h @@ -23,11 +23,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "get_target_property"; } }; #endif diff --git a/Source/cmGetTestPropertyCommand.h b/Source/cmGetTestPropertyCommand.h index d3d10cb..b17e7a1 100644 --- a/Source/cmGetTestPropertyCommand.h +++ b/Source/cmGetTestPropertyCommand.h @@ -23,11 +23,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "get_test_property"; } }; #endif diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h index c6c44cb..5877a7d 100644 --- a/Source/cmIfCommand.h +++ b/Source/cmIfCommand.h @@ -64,11 +64,6 @@ public: return false; } - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "if"; } - // Filter the given variable definition based on policy CMP0054. static const char* GetDefinitionIfUnquoted( const cmMakefile* mf, cmExpandedCommandArgument const& argument); diff --git a/Source/cmIncludeCommand.h b/Source/cmIncludeCommand.h index 5a37800..16dda0e 100644 --- a/Source/cmIncludeCommand.h +++ b/Source/cmIncludeCommand.h @@ -32,11 +32,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "include"; } }; #endif diff --git a/Source/cmIncludeDirectoryCommand.h b/Source/cmIncludeDirectoryCommand.h index abe0c05..12de698 100644 --- a/Source/cmIncludeDirectoryCommand.h +++ b/Source/cmIncludeDirectoryCommand.h @@ -33,11 +33,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "include_directories"; } - protected: // used internally void GetIncludes(const std::string& arg, std::vector<std::string>& incs); diff --git a/Source/cmIncludeExternalMSProjectCommand.h b/Source/cmIncludeExternalMSProjectCommand.h index 5274f9e..375646f 100644 --- a/Source/cmIncludeExternalMSProjectCommand.h +++ b/Source/cmIncludeExternalMSProjectCommand.h @@ -36,14 +36,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE - { - return "include_external_msproject"; - } }; #endif diff --git a/Source/cmIncludeRegularExpressionCommand.h b/Source/cmIncludeRegularExpressionCommand.h index a003360..bac4b8f 100644 --- a/Source/cmIncludeRegularExpressionCommand.h +++ b/Source/cmIncludeRegularExpressionCommand.h @@ -35,14 +35,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE - { - return "include_regular_expression"; - } }; #endif diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h index fde629b..f5d1f92 100644 --- a/Source/cmInstallCommand.h +++ b/Source/cmInstallCommand.h @@ -33,11 +33,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "install"; } - private: bool HandleScriptMode(std::vector<std::string> const& args); bool HandleTargetsMode(std::vector<std::string> const& args); diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h index 588c289..b3c27b8 100644 --- a/Source/cmInstallFilesCommand.h +++ b/Source/cmInstallFilesCommand.h @@ -34,11 +34,6 @@ public: cmExecutionStatus& status) CM_OVERRIDE; /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "install_files"; } - - /** * This is called at the end after all the information * specified by the command is accumulated. Most commands do * not implement this method. At this point, reading and diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h index 2381d79..242fb95 100644 --- a/Source/cmInstallProgramsCommand.h +++ b/Source/cmInstallProgramsCommand.h @@ -34,11 +34,6 @@ public: cmExecutionStatus& status) CM_OVERRIDE; /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "install_programs"; } - - /** * This is called at the end after all the information * specified by the command is accumulated. Most commands do * not implement this method. At this point, reading and diff --git a/Source/cmInstallTargetsCommand.h b/Source/cmInstallTargetsCommand.h index 77f461a..cc84843 100644 --- a/Source/cmInstallTargetsCommand.h +++ b/Source/cmInstallTargetsCommand.h @@ -33,11 +33,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "install_targets"; } }; #endif diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h index 334b1b8..b64e48d 100644 --- a/Source/cmLinkDirectoriesCommand.h +++ b/Source/cmLinkDirectoriesCommand.h @@ -35,11 +35,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "link_directories"; } - private: void AddLinkDir(std::string const& dir); }; diff --git a/Source/cmLinkLibrariesCommand.h b/Source/cmLinkLibrariesCommand.h index 430e5a8..f1b3a68 100644 --- a/Source/cmLinkLibrariesCommand.h +++ b/Source/cmLinkLibrariesCommand.h @@ -33,11 +33,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "link_libraries"; } }; #endif diff --git a/Source/cmListCommand.h b/Source/cmListCommand.h index 7272ea1..7789f7d 100644 --- a/Source/cmListCommand.h +++ b/Source/cmListCommand.h @@ -31,11 +31,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "list"; } - protected: bool HandleLengthCommand(std::vector<std::string> const& args); bool HandleGetCommand(std::vector<std::string> const& args); diff --git a/Source/cmLoadCacheCommand.h b/Source/cmLoadCacheCommand.h index 8dee973..1a8a0fc 100644 --- a/Source/cmLoadCacheCommand.h +++ b/Source/cmLoadCacheCommand.h @@ -33,11 +33,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "load_cache"; } - protected: std::set<std::string> VariablesToRead; std::string Prefix; diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index 5cf1853..92a32a1 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -66,11 +66,6 @@ public: return this->info.FinalPass != CM_NULLPTR; } - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return info.Name; } - static const char* LastName; static void TrapsForSignals(int sig) { @@ -246,7 +241,7 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& args, // create a function blocker and set it up cmLoadedCommand* f = new cmLoadedCommand(); (*initFunction)(&f->info); - this->Makefile->GetState()->AddCommand(f); + this->Makefile->GetState()->AddScriptedCommand(args[0], f); return true; } this->SetError("Attempt to load command failed. " diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h index 97a6bd7..030786e 100644 --- a/Source/cmLoadCommandCommand.h +++ b/Source/cmLoadCommandCommand.h @@ -18,7 +18,6 @@ public: cmCommand* Clone() CM_OVERRIDE { return new cmLoadCommandCommand; } bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - std::string GetName() const CM_OVERRIDE { return "load_command"; } }; #endif diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 507b579..a6a9ea3 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -22,11 +22,6 @@ public: ~cmMacroHelperCommand() CM_OVERRIDE {} /** - * This determines if the command is defined in a cmake script. - */ - bool IsUserDefined() const CM_OVERRIDE { return true; } - - /** * This is a virtual constructor for the command. */ cmCommand* Clone() CM_OVERRIDE @@ -53,11 +48,6 @@ public: return false; } - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return this->Args[0]; } - std::vector<std::string> Args; std::vector<cmListFileFunction> Functions; cmPolicies::PolicyMap Policies; @@ -184,10 +174,7 @@ bool cmMacroFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff, f->Functions = this->Functions; f->FilePath = this->GetStartingContext().FilePath; mf.RecordPolicies(f->Policies); - std::string newName = "_" + this->Args[0]; - mf.GetState()->RenameCommand(this->Args[0], newName); - mf.GetState()->AddCommand(f); - + mf.GetState()->AddScriptedCommand(this->Args[0], f); // remove the function blocker now that the macro is defined mf.RemoveFunctionBlocker(this, lff); return true; diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h index fd9c92b..0d35fe0 100644 --- a/Source/cmMacroCommand.h +++ b/Source/cmMacroCommand.h @@ -44,11 +44,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "macro"; } }; #endif diff --git a/Source/cmMakeDirectoryCommand.h b/Source/cmMakeDirectoryCommand.h index e2f0932..af72eab 100644 --- a/Source/cmMakeDirectoryCommand.h +++ b/Source/cmMakeDirectoryCommand.h @@ -35,11 +35,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "make_directory"; } }; #endif diff --git a/Source/cmMarkAsAdvancedCommand.h b/Source/cmMarkAsAdvancedCommand.h index 4f80746..a7791a9 100644 --- a/Source/cmMarkAsAdvancedCommand.h +++ b/Source/cmMarkAsAdvancedCommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "mark_as_advanced"; } }; #endif diff --git a/Source/cmMathCommand.h b/Source/cmMathCommand.h index ef0eb4a..67dbdda 100644 --- a/Source/cmMathCommand.h +++ b/Source/cmMathCommand.h @@ -28,11 +28,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "math"; } - protected: bool HandleExprCommand(std::vector<std::string> const& args); }; diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h index fd2dbe7..96939e5 100644 --- a/Source/cmMessageCommand.h +++ b/Source/cmMessageCommand.h @@ -30,11 +30,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "message"; } }; #endif diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h index 0227357..634e3a8 100644 --- a/Source/cmOptionCommand.h +++ b/Source/cmOptionCommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "option"; } }; #endif diff --git a/Source/cmOutputRequiredFilesCommand.h b/Source/cmOutputRequiredFilesCommand.h index e261eb0..d20bfbd 100644 --- a/Source/cmOutputRequiredFilesCommand.h +++ b/Source/cmOutputRequiredFilesCommand.h @@ -21,7 +21,6 @@ public: cmCommand* Clone() CM_OVERRIDE { return new cmOutputRequiredFilesCommand; } bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - std::string GetName() const CM_OVERRIDE { return "output_required_files"; } void ListDependencies(cmDependInformation const* info, FILE* fout, std::set<cmDependInformation const*>* visited); diff --git a/Source/cmParseArgumentsCommand.h b/Source/cmParseArgumentsCommand.h index f3de5b6..359fb85 100644 --- a/Source/cmParseArgumentsCommand.h +++ b/Source/cmParseArgumentsCommand.h @@ -29,11 +29,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "cmake_parse_arguments"; } }; #endif diff --git a/Source/cmProjectCommand.h b/Source/cmProjectCommand.h index 8fc90d2..3c579ac 100644 --- a/Source/cmProjectCommand.h +++ b/Source/cmProjectCommand.h @@ -34,11 +34,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "project"; } }; #endif diff --git a/Source/cmQTWrapCPPCommand.h b/Source/cmQTWrapCPPCommand.h index 34adf29..ad1ccf3 100644 --- a/Source/cmQTWrapCPPCommand.h +++ b/Source/cmQTWrapCPPCommand.h @@ -32,11 +32,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "qt_wrap_cpp"; } }; #endif diff --git a/Source/cmQTWrapUICommand.h b/Source/cmQTWrapUICommand.h index 279d4e9..ac7ab01 100644 --- a/Source/cmQTWrapUICommand.h +++ b/Source/cmQTWrapUICommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "qt_wrap_ui"; } }; #endif diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h index 84e591d..f2e89f6 100644 --- a/Source/cmRemoveCommand.h +++ b/Source/cmRemoveCommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "remove"; } }; #endif diff --git a/Source/cmRemoveDefinitionsCommand.h b/Source/cmRemoveDefinitionsCommand.h index 2f6c924..9a9a5d5 100644 --- a/Source/cmRemoveDefinitionsCommand.h +++ b/Source/cmRemoveDefinitionsCommand.h @@ -33,11 +33,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "remove_definitions"; } }; #endif diff --git a/Source/cmReturnCommand.h b/Source/cmReturnCommand.h index a4a6283..87900e7 100644 --- a/Source/cmReturnCommand.h +++ b/Source/cmReturnCommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "return"; } }; #endif diff --git a/Source/cmSeparateArgumentsCommand.h b/Source/cmSeparateArgumentsCommand.h index e4df5da..6bf8549 100644 --- a/Source/cmSeparateArgumentsCommand.h +++ b/Source/cmSeparateArgumentsCommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "separate_arguments"; } }; #endif diff --git a/Source/cmSetCommand.h b/Source/cmSetCommand.h index e3a3175..c0858b1 100644 --- a/Source/cmSetCommand.h +++ b/Source/cmSetCommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "set"; } }; #endif diff --git a/Source/cmSetDirectoryPropertiesCommand.h b/Source/cmSetDirectoryPropertiesCommand.h index 4657b66..8832b33 100644 --- a/Source/cmSetDirectoryPropertiesCommand.h +++ b/Source/cmSetDirectoryPropertiesCommand.h @@ -29,14 +29,6 @@ public: cmExecutionStatus& status) CM_OVERRIDE; /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE - { - return "set_directory_properties"; - } - - /** * Static entry point for use by other commands */ static bool RunCommand(cmMakefile* mf, diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h index 7f5c977..0815824 100644 --- a/Source/cmSetPropertyCommand.h +++ b/Source/cmSetPropertyCommand.h @@ -31,11 +31,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "set_property"; } - private: std::set<std::string> Names; std::string PropertyName; diff --git a/Source/cmSetSourceFilesPropertiesCommand.h b/Source/cmSetSourceFilesPropertiesCommand.h index 7dce437..2e22dc9 100644 --- a/Source/cmSetSourceFilesPropertiesCommand.h +++ b/Source/cmSetSourceFilesPropertiesCommand.h @@ -28,14 +28,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE - { - return "set_source_files_properties"; - } - static bool RunCommand(cmMakefile* mf, std::vector<std::string>::const_iterator filebeg, std::vector<std::string>::const_iterator fileend, diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h index bb34d1e..4256181 100644 --- a/Source/cmSetTargetPropertiesCommand.h +++ b/Source/cmSetTargetPropertiesCommand.h @@ -26,11 +26,6 @@ public: cmExecutionStatus& status) CM_OVERRIDE; /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "set_target_properties"; } - - /** * Used by this command and cmSetPropertiesCommand */ static bool SetOneTarget(const std::string& tname, diff --git a/Source/cmSetTestsPropertiesCommand.h b/Source/cmSetTestsPropertiesCommand.h index 56a864f..90f004c 100644 --- a/Source/cmSetTestsPropertiesCommand.h +++ b/Source/cmSetTestsPropertiesCommand.h @@ -25,11 +25,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "set_tests_properties"; } - static bool SetOneTest(const std::string& tname, std::vector<std::string>& propertyPairs, cmMakefile* mf, std::string& errors); diff --git a/Source/cmSiteNameCommand.h b/Source/cmSiteNameCommand.h index e133c6c..6c65480 100644 --- a/Source/cmSiteNameCommand.h +++ b/Source/cmSiteNameCommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "site_name"; } }; #endif diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h index 3086177..7d56b0d 100644 --- a/Source/cmSourceGroupCommand.h +++ b/Source/cmSourceGroupCommand.h @@ -33,11 +33,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "source_group"; } - private: bool processTree(const std::vector<std::string>& args, std::string& errorMsg); diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 43f439c..ce9f470 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -12,10 +12,12 @@ #include "cmCacheManager.h" #include "cmCommand.h" #include "cmDefinitions.h" +#include "cmDisallowedCommand.h" #include "cmListFileCache.h" #include "cmStatePrivate.h" #include "cmStateSnapshot.h" #include "cmSystemTools.h" +#include "cmUnexpectedCommand.h" #include "cmake.h" cmState::cmState() @@ -34,7 +36,8 @@ cmState::cmState() cmState::~cmState() { delete this->CacheManager; - cmDeleteAll(this->Commands); + cmDeleteAll(this->BuiltinCommands); + cmDeleteAll(this->ScriptedCommands); } const char* cmState::GetTargetTypeName(cmStateEnums::TargetType targetType) @@ -375,84 +378,92 @@ void cmState::SetIsGeneratorMultiConfig(bool b) this->IsGeneratorMultiConfig = b; } -void cmState::RenameCommand(std::string const& oldName, - std::string const& newName) +void cmState::AddBuiltinCommand(std::string const& name, cmCommand* command) { - // if the command already exists, free the old one - std::string sOldName = cmSystemTools::LowerCase(oldName); - std::string sNewName = cmSystemTools::LowerCase(newName); - std::map<std::string, cmCommand*>::iterator pos = - this->Commands.find(sOldName); - if (pos == this->Commands.end()) { - return; - } - cmCommand* cmd = pos->second; + assert(name == cmSystemTools::LowerCase(name)); + assert(this->BuiltinCommands.find(name) == this->BuiltinCommands.end()); + this->BuiltinCommands.insert(std::make_pair(name, command)); +} - pos = this->Commands.find(sNewName); - if (pos != this->Commands.end()) { - delete pos->second; - this->Commands.erase(pos); - } - this->Commands.insert(std::make_pair(sNewName, cmd)); - pos = this->Commands.find(sOldName); - this->Commands.erase(pos); +void cmState::AddDisallowedCommand(std::string const& name, cmCommand* command, + cmPolicies::PolicyID policy, + const char* message) +{ + this->AddBuiltinCommand(name, + new cmDisallowedCommand(command, policy, message)); +} + +void cmState::AddUnexpectedCommand(std::string const& name, const char* error) +{ + this->AddBuiltinCommand(name, new cmUnexpectedCommand(name, error)); } -void cmState::AddCommand(cmCommand* command) +void cmState::AddScriptedCommand(std::string const& name, cmCommand* command) { - std::string name = cmSystemTools::LowerCase(command->GetName()); + std::string sName = cmSystemTools::LowerCase(name); + + // if the command already exists, give a new name to the old command. + if (cmCommand* oldCmd = this->GetCommand(sName)) { + std::string const newName = "_" + sName; + std::map<std::string, cmCommand*>::iterator pos = + this->ScriptedCommands.find(newName); + if (pos != this->ScriptedCommands.end()) { + delete pos->second; + this->ScriptedCommands.erase(pos); + } + this->ScriptedCommands.insert(std::make_pair(newName, oldCmd->Clone())); + } + // if the command already exists, free the old one - std::map<std::string, cmCommand*>::iterator pos = this->Commands.find(name); - if (pos != this->Commands.end()) { + std::map<std::string, cmCommand*>::iterator pos = + this->ScriptedCommands.find(sName); + if (pos != this->ScriptedCommands.end()) { delete pos->second; - this->Commands.erase(pos); + this->ScriptedCommands.erase(pos); } - this->Commands.insert(std::make_pair(name, command)); + this->ScriptedCommands.insert(std::make_pair(sName, command)); } cmCommand* cmState::GetCommand(std::string const& name) const { - cmCommand* command = CM_NULLPTR; std::string sName = cmSystemTools::LowerCase(name); - std::map<std::string, cmCommand*>::const_iterator pos = - this->Commands.find(sName); - if (pos != this->Commands.end()) { - command = (*pos).second; + std::map<std::string, cmCommand*>::const_iterator pos; + pos = this->ScriptedCommands.find(sName); + if (pos != this->ScriptedCommands.end()) { + return pos->second; + } + pos = this->BuiltinCommands.find(sName); + if (pos != this->BuiltinCommands.end()) { + return pos->second; } - return command; + return CM_NULLPTR; } std::vector<std::string> cmState::GetCommandNames() const { std::vector<std::string> commandNames; - commandNames.reserve(this->Commands.size()); - std::map<std::string, cmCommand*>::const_iterator cmds = - this->Commands.begin(); - for (; cmds != this->Commands.end(); ++cmds) { + commandNames.reserve(this->BuiltinCommands.size() + + this->ScriptedCommands.size()); + for (std::map<std::string, cmCommand*>::const_iterator cmds = + this->BuiltinCommands.begin(); + cmds != this->BuiltinCommands.end(); ++cmds) { commandNames.push_back(cmds->first); } + for (std::map<std::string, cmCommand*>::const_iterator cmds = + this->ScriptedCommands.begin(); + cmds != this->ScriptedCommands.end(); ++cmds) { + commandNames.push_back(cmds->first); + } + std::sort(commandNames.begin(), commandNames.end()); + commandNames.erase(std::unique(commandNames.begin(), commandNames.end()), + commandNames.end()); return commandNames; } void cmState::RemoveUserDefinedCommands() { - std::vector<cmCommand*> renamedCommands; - for (std::map<std::string, cmCommand*>::iterator j = this->Commands.begin(); - j != this->Commands.end();) { - if (j->second->IsUserDefined()) { - delete j->second; - this->Commands.erase(j++); - } else if (j->first != j->second->GetName()) { - renamedCommands.push_back(j->second); - this->Commands.erase(j++); - } else { - ++j; - } - } - for (std::vector<cmCommand*>::const_iterator it = renamedCommands.begin(); - it != renamedCommands.end(); ++it) { - this->Commands[cmSystemTools::LowerCase((*it)->GetName())] = *it; - } + cmDeleteAll(this->ScriptedCommands); + this->ScriptedCommands.clear(); } void cmState::SetGlobalProperty(const std::string& prop, const char* value) diff --git a/Source/cmState.h b/Source/cmState.h index 240d75b..1a5738f 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -12,6 +12,7 @@ #include "cmDefinitions.h" #include "cmLinkedTree.h" +#include "cmPolicies.h" #include "cmProperty.h" #include "cmPropertyDefinitionMap.h" #include "cmPropertyMap.h" @@ -120,8 +121,11 @@ public: void SetIsGeneratorMultiConfig(bool b); cmCommand* GetCommand(std::string const& name) const; - void AddCommand(cmCommand* command); - void RenameCommand(std::string const& oldName, std::string const& newName); + void AddBuiltinCommand(std::string const& name, cmCommand* command); + void AddDisallowedCommand(std::string const& name, cmCommand* command, + cmPolicies::PolicyID policy, const char* message); + void AddUnexpectedCommand(std::string const& name, const char* error); + void AddScriptedCommand(std::string const& name, cmCommand* command); void RemoveUserDefinedCommands(); std::vector<std::string> GetCommandNames() const; @@ -160,7 +164,8 @@ private: std::map<cmProperty::ScopeType, cmPropertyDefinitionMap> PropertyDefinitions; std::vector<std::string> EnabledLanguages; - std::map<std::string, cmCommand*> Commands; + std::map<std::string, cmCommand*> BuiltinCommands; + std::map<std::string, cmCommand*> ScriptedCommands; cmPropertyMap GlobalProperties; cmCacheManager* CacheManager; diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index dc3ce5a..88015ad 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -31,11 +31,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "string"; } - protected: bool HandleConfigureCommand(std::vector<std::string> const& args); bool HandleAsciiCommand(std::vector<std::string> const& args); diff --git a/Source/cmSubdirCommand.h b/Source/cmSubdirCommand.h index ce2168d..a2af0fd 100644 --- a/Source/cmSubdirCommand.h +++ b/Source/cmSubdirCommand.h @@ -33,11 +33,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "subdirs"; } }; #endif diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h index ae8fbaf..d8ea928 100644 --- a/Source/cmSubdirDependsCommand.h +++ b/Source/cmSubdirDependsCommand.h @@ -18,7 +18,6 @@ public: cmCommand* Clone() CM_OVERRIDE { return new cmSubdirDependsCommand; } bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - std::string GetName() const CM_OVERRIDE { return "subdir_depends"; } }; #endif diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h index 663b9d0..11abf57 100644 --- a/Source/cmTargetCompileDefinitionsCommand.h +++ b/Source/cmTargetCompileDefinitionsCommand.h @@ -32,14 +32,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE - { - return "target_compile_definitions"; - } - private: void HandleImportedTarget(const std::string& tgt) CM_OVERRIDE; void HandleMissingTarget(const std::string& name) CM_OVERRIDE; diff --git a/Source/cmTargetCompileFeaturesCommand.h b/Source/cmTargetCompileFeaturesCommand.h index 95214bf..9908680 100644 --- a/Source/cmTargetCompileFeaturesCommand.h +++ b/Source/cmTargetCompileFeaturesCommand.h @@ -21,8 +21,6 @@ class cmTargetCompileFeaturesCommand : public cmTargetPropCommandBase bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - std::string GetName() const CM_OVERRIDE { return "target_compile_features"; } - private: void HandleImportedTarget(const std::string& tgt) CM_OVERRIDE; void HandleMissingTarget(const std::string& name) CM_OVERRIDE; diff --git a/Source/cmTargetCompileOptionsCommand.h b/Source/cmTargetCompileOptionsCommand.h index e4dfa75..b5408f7 100644 --- a/Source/cmTargetCompileOptionsCommand.h +++ b/Source/cmTargetCompileOptionsCommand.h @@ -29,11 +29,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "target_compile_options"; } - private: void HandleImportedTarget(const std::string& tgt) CM_OVERRIDE; void HandleMissingTarget(const std::string& name) CM_OVERRIDE; diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h index d6d33f2..374a867 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.h +++ b/Source/cmTargetIncludeDirectoriesCommand.h @@ -32,14 +32,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE - { - return "target_include_directories"; - } - private: void HandleImportedTarget(const std::string& tgt) CM_OVERRIDE; void HandleMissingTarget(const std::string& name) CM_OVERRIDE; diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h index bfa233e..3fd20ac 100644 --- a/Source/cmTargetLinkLibrariesCommand.h +++ b/Source/cmTargetLinkLibrariesCommand.h @@ -36,11 +36,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "target_link_libraries"; } - private: void LinkLibraryTypeSpecifierWarning(int left, int right); static const char* LinkLibraryTypeNames[3]; diff --git a/Source/cmTargetSourcesCommand.h b/Source/cmTargetSourcesCommand.h index 6cc1abc..09ba729 100644 --- a/Source/cmTargetSourcesCommand.h +++ b/Source/cmTargetSourcesCommand.h @@ -29,11 +29,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "target_sources"; } - private: void HandleImportedTarget(const std::string& tgt) CM_OVERRIDE; void HandleMissingTarget(const std::string& name) CM_OVERRIDE; diff --git a/Source/cmTryCompileCommand.h b/Source/cmTryCompileCommand.h index 8972f7e..4836548 100644 --- a/Source/cmTryCompileCommand.h +++ b/Source/cmTryCompileCommand.h @@ -32,11 +32,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "try_compile"; } }; #endif diff --git a/Source/cmTryRunCommand.h b/Source/cmTryRunCommand.h index b086dde..c27b026 100644 --- a/Source/cmTryRunCommand.h +++ b/Source/cmTryRunCommand.h @@ -33,11 +33,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "try_run"; } - private: void RunExecutable(const std::string& runArgs, std::string* runOutputContents); diff --git a/Source/cmUnexpectedCommand.h b/Source/cmUnexpectedCommand.h index 1605997..995d8a5 100644 --- a/Source/cmUnexpectedCommand.h +++ b/Source/cmUnexpectedCommand.h @@ -29,8 +29,6 @@ public: bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - std::string GetName() const CM_OVERRIDE { return this->Name; } - private: std::string Name; const char* Error; diff --git a/Source/cmUnsetCommand.h b/Source/cmUnsetCommand.h index d60bd3e..2a1f3f0 100644 --- a/Source/cmUnsetCommand.h +++ b/Source/cmUnsetCommand.h @@ -31,11 +31,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "unset"; } }; #endif diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h index 104614a..5118829 100644 --- a/Source/cmUseMangledMesaCommand.h +++ b/Source/cmUseMangledMesaCommand.h @@ -18,7 +18,7 @@ public: cmCommand* Clone() CM_OVERRIDE { return new cmUseMangledMesaCommand; } bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - std::string GetName() const CM_OVERRIDE { return "use_mangled_mesa"; } + protected: void CopyAndFullPathMesaHeader(const char* source, const char* outdir); }; diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h index fa818bf..a95b48d 100644 --- a/Source/cmUtilitySourceCommand.h +++ b/Source/cmUtilitySourceCommand.h @@ -18,7 +18,6 @@ public: cmCommand* Clone() CM_OVERRIDE { return new cmUtilitySourceCommand; } bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - std::string GetName() const CM_OVERRIDE { return "utility_source"; } }; #endif diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h index 6afb11a..9808d5f 100644 --- a/Source/cmVariableRequiresCommand.h +++ b/Source/cmVariableRequiresCommand.h @@ -18,7 +18,6 @@ public: cmCommand* Clone() CM_OVERRIDE { return new cmVariableRequiresCommand; } bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - std::string GetName() const CM_OVERRIDE { return "variable_requires"; } }; #endif diff --git a/Source/cmVariableWatchCommand.h b/Source/cmVariableWatchCommand.h index ca338e6..9f04391 100644 --- a/Source/cmVariableWatchCommand.h +++ b/Source/cmVariableWatchCommand.h @@ -42,11 +42,6 @@ public: stay alive since it owns variable watch callback information. */ bool HasFinalPass() const CM_OVERRIDE { return true; } - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "variable_watch"; } - protected: std::set<std::string> WatchedVariables; }; diff --git a/Source/cmWhileCommand.h b/Source/cmWhileCommand.h index d353063..a95e4c3 100644 --- a/Source/cmWhileCommand.h +++ b/Source/cmWhileCommand.h @@ -57,11 +57,6 @@ public: { return false; } - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "while"; } }; #endif diff --git a/Source/cmWriteFileCommand.h b/Source/cmWriteFileCommand.h index aea8653..19922cd 100644 --- a/Source/cmWriteFileCommand.h +++ b/Source/cmWriteFileCommand.h @@ -30,11 +30,6 @@ public: */ bool InitialPass(std::vector<std::string> const& args, cmExecutionStatus& status) CM_OVERRIDE; - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "write_file"; } }; #endif diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index f472b8a..6e65955 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -289,7 +289,9 @@ int do_cmake(int ac, char const* const* av) int ret = cm.GetSystemInformation(args); return ret; } - cmake cm(cmake::RoleProject); + cmake::Role const role = + workingMode == cmake::NORMAL_MODE ? cmake::RoleProject : cmake::RoleScript; + cmake cm(role); cm.SetHomeDirectory(""); cm.SetHomeOutputDirectory(""); cmSystemTools::SetMessageCallback(cmakemainMessageCallback, (void*)&cm); @@ -274,6 +274,7 @@ CMAKE_CXX_SOURCES="\ cmDefinitions \ cmDepends \ cmDependsC \ + cmDisallowedCommand \ cmDocumentationFormatter \ cmEnableLanguageCommand \ cmEnableTestingCommand \ |