[Cmake-commits] CMake branch, next, updated. v3.3.0-rc3-987-g3b0a47c
Stephen Kelly
steveire at gmail.com
Sat Jul 11 05:01:52 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 3b0a47cddf40e22e4341af33030c15a1251ba8a8 (commit)
via 88ecf38ede983f26082f1512c247e9af2fbb4b8d (commit)
from 053ce6c906ad95861eaf12e9fe0ef9fcb8d1f6ad (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3b0a47cddf40e22e4341af33030c15a1251ba8a8
commit 3b0a47cddf40e22e4341af33030c15a1251ba8a8
Merge: 053ce6c 88ecf38
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 11 05:01:51 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Jul 11 05:01:51 2015 -0400
Merge topic 'fix-command-rename' into next
88ecf38e cmState: Restore renamed commands on cleanup.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=88ecf38ede983f26082f1512c247e9af2fbb4b8d
commit 88ecf38ede983f26082f1512c247e9af2fbb4b8d
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 11 10:51:36 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Jul 11 11:01:11 2015 +0200
cmState: Restore renamed commands on cleanup.
Commit v3.3.0-rc1~196^2~7 (cmake: Simplify command clean up
loop., 2015-04-12) introduced a bug that built-in commands which
were renamed no longer had their original name restored when
cleanup is performed between configure runs. Check for that
and restore the commands with their original name.
Extend the complex test for this. That test is run by ctest with
the --build-two-config command line option.
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index d918f65..45152cd 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -430,6 +430,7 @@ std::vector<std::string> cmState::GetCommandNames() const
void cmState::RemoveUserDefinedCommands()
{
+ std::vector<cmCommand*> renamedCommands;
for(std::map<std::string, cmCommand*>::iterator j = this->Commands.begin();
j != this->Commands.end(); )
{
@@ -441,9 +442,19 @@ void cmState::RemoveUserDefinedCommands()
}
else
{
+ if (j->first != j->second->GetName())
+ {
+ renamedCommands.push_back(j->second);
+ this->Commands.erase(j);
+ }
++j;
}
}
+ for (std::vector<cmCommand*>::const_iterator it = renamedCommands.begin();
+ it != renamedCommands.end(); ++it)
+ {
+ this->Commands[cmSystemTools::LowerCase((*it)->GetName())] = *it;
+ }
}
void cmState::SetGlobalProperty(const std::string& prop, const char* value)
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 5e5eead..9251ff3 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -4,6 +4,13 @@
cmake_minimum_required(VERSION 2.4)
project (Complex)
+# Test that renaming a built-in works when configured multiple times.
+message("message")
+function(message)
+ _message(${ARGN})
+endfunction()
+message("message")
+
# Try setting a new policy. The IF test is for coverage.
if(POLICY CMP0003)
cmake_policy(SET CMP0003 NEW)
-----------------------------------------------------------------------
Summary of changes:
Source/cmState.cxx | 11 +++++++++++
Tests/Complex/CMakeLists.txt | 7 +++++++
2 files changed, 18 insertions(+)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list