mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-26 02:38:37 -06:00
Merge branch 'set_directory_properties-script-mode' into release-3.13
Merge-request: !2544
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ add_RunCMake_test(ObjectLibrary)
|
||||
if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
|
||||
add_RunCMake_test(RuntimePath)
|
||||
endif()
|
||||
add_RunCMake_test(ScriptMode)
|
||||
add_RunCMake_test(Swift)
|
||||
add_RunCMake_test(TargetObjects)
|
||||
add_RunCMake_test(TargetSources)
|
||||
|
||||
3
Tests/RunCMake/ScriptMode/RunCMakeTest.cmake
Normal file
3
Tests/RunCMake/ScriptMode/RunCMakeTest.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
include(RunCMake)
|
||||
|
||||
run_cmake_command(set_directory_properties ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/set_directory_properties.cmake)
|
||||
1
Tests/RunCMake/ScriptMode/set_directory_properties.cmake
Normal file
1
Tests/RunCMake/ScriptMode/set_directory_properties.cmake
Normal file
@@ -0,0 +1 @@
|
||||
set_directory_properties(PROPERTIES SOME_PROPERTY FALSE)
|
||||
Reference in New Issue
Block a user