[Cmake-commits] CMake branch, next, updated. v2.8.5-1974-g3bf4d85
Brad King
brad.king at kitware.com
Mon Sep 26 11:28:20 EDT 2011
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 3bf4d8587ddb25d33a578943d974474bfc419364 (commit)
via 9149033c99b53c1e9c8e9c77e8a9165d745f1be5 (commit)
via b0cd630521658ddf8f8547597ac9c24a725f20e7 (commit)
from 8525b1750b37d925c388d2d0b5b387819aad4fe9 (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=3bf4d8587ddb25d33a578943d974474bfc419364
commit 3bf4d8587ddb25d33a578943d974474bfc419364
Merge: 8525b17 9149033
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Sep 26 11:28:08 2011 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Sep 26 11:28:08 2011 -0400
Merge topic 'find_package-win-prefix-issue-12475' into next
9149033 Windows: Do not search root-relative paths (#12475)
b0cd630 Refactor find_* command final path list computation
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9149033c99b53c1e9c8e9c77e8a9165d745f1be5
commit 9149033c99b53c1e9c8e9c77e8a9165d745f1be5
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 23 14:49:12 2011 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 23 14:55:36 2011 -0400
Windows: Do not search root-relative paths (#12475)
On Windows the CMAKE_SYSTEM_PREFIX_PATH includes plain "/" so that
CMAKE_FIND_ROOT_PATH may be set directly to an installation prefix
during cross-compiling (e.g. with MinGW tools). Do not use paths
generated directly from this prefix on Windows because they have no
drive letter and are therefore "root-relative" paths.
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index b44864e..2755bee 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -473,7 +473,13 @@ void cmFindCommon::AddPathInternal(std::string const& in_path,
//----------------------------------------------------------------------------
void cmFindCommon::ComputeFinalPaths()
{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+# define cmFindCommon_ComputeFinalPaths_WindowsPaths
+ std::vector<std::string> paths;
+ this->SearchPaths.swap(paths);
+#else
std::vector<std::string>& paths = this->SearchPaths;
+#endif
// Expand list of paths inside all search roots.
this->RerootPaths(paths);
@@ -487,6 +493,13 @@ void cmFindCommon::ComputeFinalPaths()
{
p += "/";
}
+#ifdef cmFindCommon_ComputeFinalPaths_WindowsPaths
+ // Exclude "root-relative" paths starting in a single slash.
+ if(p.size() >= 2 && (p[0] != '/' || p[1] == '/'))
+ {
+ this->SearchPaths.push_back(p);
+ }
+#endif
}
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0cd630521658ddf8f8547597ac9c24a725f20e7
commit b0cd630521658ddf8f8547597ac9c24a725f20e7
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 23 14:27:25 2011 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 23 14:36:27 2011 -0400
Refactor find_* command final path list computation
All find_* commands re-root the list of paths and then add trailing
slashes. Factor this pair of calls out into a dedicated method. The
new method would be the only caller to AddTrailingSlashes, so subsume
that method into it.
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index ce9deb1..183da4a 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -299,11 +299,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
this->GetIgnoredPaths(ignored);
this->FilterPaths(this->SearchPaths, ignored);
- // Handle search root stuff.
- this->RerootPaths(this->SearchPaths);
-
- // Add a trailing slash to all prefixes to aid the search process.
- this->AddTrailingSlashes(this->SearchPaths);
+ this->ComputeFinalPaths();
return true;
}
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index a05e337..b44864e 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -471,8 +471,13 @@ void cmFindCommon::AddPathInternal(std::string const& in_path,
}
//----------------------------------------------------------------------------
-void cmFindCommon::AddTrailingSlashes(std::vector<std::string>& paths)
+void cmFindCommon::ComputeFinalPaths()
{
+ std::vector<std::string>& paths = this->SearchPaths;
+
+ // Expand list of paths inside all search roots.
+ this->RerootPaths(paths);
+
// Add a trailing slash to all paths to aid the search process.
for(std::vector<std::string>::iterator i = paths.begin();
i != paths.end(); ++i)
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index 875c223..542805f 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -47,8 +47,8 @@ protected:
void FilterPaths(std::vector<std::string>& paths,
const std::set<std::string>& ignore);
- /** Add trailing slashes to all search paths. */
- void AddTrailingSlashes(std::vector<std::string>& paths);
+ /** Compute final search path list (reroot + trailing slash). */
+ void ComputeFinalPaths();
/** Compute the current default root path mode. */
void SelectDefaultRootPathMode();
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 2e72b58..7d3f09b 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1243,7 +1243,7 @@ void cmFindPackageCommand::ComputePrefixes()
this->AddPrefixesCMakeSystemVariable();
this->AddPrefixesSystemRegistry();
this->AddPrefixesUserGuess();
- this->ComputeFinalPrefixes();
+ this->ComputeFinalPaths();
}
//----------------------------------------------------------------------------
@@ -1574,18 +1574,6 @@ void cmFindPackageCommand::AddPrefixesUserHints()
}
//----------------------------------------------------------------------------
-void cmFindPackageCommand::ComputeFinalPrefixes()
-{
- std::vector<std::string>& prefixes = this->SearchPaths;
-
- // Construct the final set of prefixes.
- this->RerootPaths(prefixes);
-
- // Add a trailing slash to all prefixes to aid the search process.
- this->AddTrailingSlashes(prefixes);
-}
-
-//----------------------------------------------------------------------------
bool cmFindPackageCommand::SearchDirectory(std::string const& dir)
{
assert(!dir.empty() && dir[dir.size()-1] == '/');
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index 2b2e1da..e736352 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -93,7 +93,6 @@ private:
void AddPrefixesCMakeSystemVariable();
void AddPrefixesUserGuess();
void AddPrefixesUserHints();
- void ComputeFinalPrefixes();
void LoadPackageRegistryDir(std::string const& dir);
void LoadPackageRegistryWinUser();
void LoadPackageRegistryWinSystem();
-----------------------------------------------------------------------
Summary of changes:
Source/cmFindBase.cxx | 6 +-----
Source/cmFindCommon.cxx | 20 +++++++++++++++++++-
Source/cmFindCommon.h | 4 ++--
Source/cmFindPackageCommand.cxx | 14 +-------------
Source/cmFindPackageCommand.h | 1 -
5 files changed, 23 insertions(+), 22 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list