[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2470-g31360ce
Brad King
brad.king at kitware.com
Tue Mar 12 13:50:23 EDT 2013
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 31360ce97c765321dec38d02d6e213e68572d68c (commit)
via 1df49282a5649c9ad9f8769cb552423ad74adbfb (commit)
from 4b140f30f30bfe6d7b7aa58d0bd51bab04814b35 (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=31360ce97c765321dec38d02d6e213e68572d68c
commit 31360ce97c765321dec38d02d6e213e68572d68c
Merge: 4b140f3 1df4928
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 12 13:50:22 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Mar 12 13:50:22 2013 -0400
Merge topic 'add_subdirectory-trailing-slashes' into next
1df4928 add_subdirectory: Compute output dir with consistent slashes (#10072)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1df49282a5649c9ad9f8769cb552423ad74adbfb
commit 1df49282a5649c9ad9f8769cb552423ad74adbfb
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 12 11:47:49 2013 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Mar 12 11:52:52 2013 -0400
add_subdirectory: Compute output dir with consistent slashes (#10072)
When the command is invoked without an explicit build directory path we
compute it from the source directory path. When either the source or
build tree is the root of a Windows drive letter it will have a trailing
slash. Handle slashes consistently when substituting the current output
directory for the current source directory.
While at it, use cmSystemTools::IsSubDirectory instead of FindLastString
to verify that the source directory is a subdirectory.
Inspired-by: Graham Menhennitt <graham at menhennitt.com.au>
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx
index 9efeda4..5b1c9c6 100644
--- a/Source/cmAddSubDirectoryCommand.cxx
+++ b/Source/cmAddSubDirectoryCommand.cxx
@@ -78,7 +78,7 @@ bool cmAddSubDirectoryCommand::InitialPass
// No binary directory was specified. If the source directory is
// not a subdirectory of the current directory then it is an
// error.
- if(!cmSystemTools::FindLastString(srcPath.c_str(),
+ if(!cmSystemTools::IsSubDirectory(srcPath.c_str(),
this->Makefile->GetCurrentDirectory()))
{
cmOStringStream e;
@@ -93,10 +93,15 @@ bool cmAddSubDirectoryCommand::InitialPass
// Remove the CurrentDirectory from the srcPath and replace it
// with the CurrentOutputDirectory.
- binPath = srcPath;
- cmSystemTools::ReplaceString(binPath,
- this->Makefile->GetCurrentDirectory(),
- this->Makefile->GetCurrentOutputDirectory());
+ const char* src = this->Makefile->GetCurrentDirectory();
+ const char* bin = this->Makefile->GetCurrentOutputDirectory();
+ size_t srcLen = strlen(src);
+ size_t binLen = strlen(bin);
+ if(srcLen > 0 && src[srcLen-1] == '/')
+ { --srcLen; }
+ if(binLen > 0 && bin[binLen-1] == '/')
+ { --binLen; }
+ binPath = std::string(bin, binLen) + srcPath.substr(srcLen);
}
else
{
-----------------------------------------------------------------------
Summary of changes:
Source/cmAddSubDirectoryCommand.cxx | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list