[Cmake-commits] CMake branch, next, updated. v2.8.3-1352-gea7ad70

Brad King brad.king at kitware.com
Fri Jan 14 10:13:49 EST 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  ea7ad70d1b8496b836932bdb862ae38bcce7efa2 (commit)
       via  8704525f201452929a2bec96fb04387c97ad8a79 (commit)
      from  03171f2cbffca67c3ba494274856237c5b9b85bb (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=ea7ad70d1b8496b836932bdb862ae38bcce7efa2
commit ea7ad70d1b8496b836932bdb862ae38bcce7efa2
Merge: 03171f2 8704525
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 14 10:13:13 2011 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 14 10:13:13 2011 -0500

    Merge topic 'disallow-funny-path-names' into next
    
    8704525 Reject directory names containing '=' (#11689)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8704525f201452929a2bec96fb04387c97ad8a79
commit 8704525f201452929a2bec96fb04387c97ad8a79
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 14 10:03:22 2011 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Jan 14 10:03:22 2011 -0500

    Reject directory names containing '=' (#11689)
    
    Some characters are not well-supported by native build systems.  Reject
    paths containing such characters before even trying to configure a
    project.

diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 1b49837..bc3245e 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1946,8 +1946,32 @@ int cmake::Configure()
 
 }
 
+bool cmake::RejectUnsupportedPaths(const char* desc, std::string const& path)
+{
+  // Some characters are not well-supported by native build systems.
+  std::string::size_type pos = path.find_first_of("=");
+  if(pos == std::string::npos)
+    {
+    return false;
+    }
+  cmOStringStream e;
+  e << "The path to the " << desc << " directory:\n"
+    << "  " << path << "\n"
+    << "contains unsupported character '" << path[pos] << "'.\n"
+    << "Please use a different " << desc << " directory name.";
+  cmListFileBacktrace bt;
+  this->IssueMessage(cmake::FATAL_ERROR, e.str(), bt);
+  return true;
+}
+
 int cmake::ActualConfigure()
 {
+  if(this->RejectUnsupportedPaths("source", this->cmHomeDirectory) ||
+     this->RejectUnsupportedPaths("binary", this->HomeOutputDirectory))
+    {
+    return 1;
+    }
+
   // Construct right now our path conversion table before it's too late:
   this->UpdateConversionPathTable();
   this->CleanupCommandsAndMacros();
diff --git a/Source/cmake.h b/Source/cmake.h
index 435d38b..6744ca1 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -435,6 +435,8 @@ protected:
 
   ///! Find the full path to one of the cmake programs like ctest, cpack, etc.
   std::string FindCMakeProgram(const char* name) const;
+
+  bool RejectUnsupportedPaths(const char* desc, std::string const& path);
 private:
   cmake(const cmake&);  // Not implemented.
   void operator=(const cmake&);  // Not implemented.

-----------------------------------------------------------------------

Summary of changes:
 Source/cmake.cxx |   24 ++++++++++++++++++++++++
 Source/cmake.h   |    2 ++
 2 files changed, 26 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list