diff options
author | Brad King <brad.king@kitware.com> | 2018-10-29 15:45:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-29 15:45:49 (GMT) |
commit | 44cef5fd9204dab2872ca87ed3c56947218aeb75 (patch) | |
tree | c6ff7f681a497e9e3ba9079868e2a4616853741b /Source | |
parent | 97624af75125a6d6ad2fcc181fe8645bf1abfb5f (diff) | |
parent | 50572d638b3903f2c2af636dcfe9d3765fd87a7c (diff) | |
download | CMake-44cef5fd9204dab2872ca87ed3c56947218aeb75.zip CMake-44cef5fd9204dab2872ca87ed3c56947218aeb75.tar.gz CMake-44cef5fd9204dab2872ca87ed3c56947218aeb75.tar.bz2 |
Merge branch 'set_directory_properties-script-mode' into release-3.13
Merge-request: !2544
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 1 | ||||
-rw-r--r-- | Source/cmCommands.cxx | 4 | ||||
-rw-r--r-- | Source/cmState.cxx | 10 | ||||
-rw-r--r-- | Source/cmState.h | 1 |
4 files changed, 14 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 7fb5e80..c936910 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1686,6 +1686,7 @@ void cmCTestTestHandler::GetListOfTests() cm.GetState()->AddBuiltinCommand("set_tests_properties", newCom4); // Add handler for SET_DIRECTORY_PROPERTIES + cm.GetState()->RemoveBuiltinCommand("set_directory_properties"); cmCTestSetDirectoryPropertiesCommand* newCom5 = new cmCTestSetDirectoryPropertiesCommand; newCom5->TestHandler = this; diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index 873372f..63c5397 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -151,6 +151,8 @@ void GetScriptingCommands(cmState* state) 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); @@ -240,8 +242,6 @@ void GetProjectCommands(cmState* state) state->AddBuiltinCommand("install_targets", new cmInstallTargetsCommand); state->AddBuiltinCommand("link_directories", new cmLinkDirectoriesCommand); state->AddBuiltinCommand("project", new cmProjectCommand); - state->AddBuiltinCommand("set_directory_properties", - new cmSetDirectoryPropertiesCommand); state->AddBuiltinCommand("set_source_files_properties", new cmSetSourceFilesPropertiesCommand); state->AddBuiltinCommand("set_target_properties", diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 4b65cf1..a2008a0 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -502,6 +502,16 @@ std::vector<std::string> cmState::GetCommandNames() const return commandNames; } +void cmState::RemoveBuiltinCommand(std::string const& name) +{ + assert(name == cmSystemTools::LowerCase(name)); + std::map<std::string, cmCommand*>::iterator i = + this->BuiltinCommands.find(name); + assert(i != this->BuiltinCommands.end()); + delete i->second; + this->BuiltinCommands.erase(i); +} + void cmState::RemoveUserDefinedCommands() { cmDeleteAll(this->ScriptedCommands); diff --git a/Source/cmState.h b/Source/cmState.h index ca7093a..916985d 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -135,6 +135,7 @@ public: cmPolicies::PolicyID policy, const char* message); void AddUnexpectedCommand(std::string const& name, const char* error); void AddScriptedCommand(std::string const& name, cmCommand* command); + void RemoveBuiltinCommand(std::string const& name); void RemoveUserDefinedCommands(); std::vector<std::string> GetCommandNames() const; |