diff --git a/SystemTools.cxx b/SystemTools.cxx
index d479ee144c0287ecf6e996ccba02bf89d33ceac9..eb2bec65fc66ef41a8aed80d50f1e998b8a080c9 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -1291,6 +1291,32 @@ bool SystemTools::SameFile(const std::string& file1, const std::string& file2)
 #endif
 }
 
+//----------------------------------------------------------------------------
+bool SystemTools::PathExists(const std::string& path)
+{
+  if(path.empty())
+    {
+    return false;
+    }
+#if defined(__CYGWIN__)
+  // Convert path to native windows path if possible.
+  char winpath[MAX_PATH];
+  if(SystemTools::PathCygwinToWin32(path.c_str(), winpath))
+    {
+    return (GetFileAttributesA(winpath) != INVALID_FILE_ATTRIBUTES);
+    }
+  struct stat st;
+  return lstat(path.c_str(), &st) == 0;
+#elif defined(_WIN32)
+  return (GetFileAttributesW(
+            SystemTools::ConvertToWindowsExtendedPath(path).c_str())
+          != INVALID_FILE_ATTRIBUTES);
+#else
+  struct stat st;
+  return lstat(path.c_str(), &st) == 0;
+#endif
+}
+
 //----------------------------------------------------------------------------
 bool SystemTools::FileExists(const char* filename)
 {
diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in
index aa1bf1bfabb2e6d1892ccb7b1f6d6d4b7cc6e3b7..28ff0b39e25b13171108b60d2c6f521baf10f43f 100644
--- a/SystemTools.hxx.in
+++ b/SystemTools.hxx.in
@@ -305,6 +305,11 @@ public:
    */
   static std::string ConvertToWindowsOutputPath(const std::string&);
 
+  /**
+   * Return true if a path with the given name exists in the current directory.
+   */
+  static bool PathExists(const std::string& path);
+
   /**
    * Return true if a file exists in the current directory.
    * If isFile = true, then make sure the file is a file and
diff --git a/testSystemTools.cxx b/testSystemTools.cxx
index 4dab34766f97cf29c6499317f37d0d38506f2982..9252ea6e30a4ad0f520492afd94cc6da3ec76e7a 100644
--- a/testSystemTools.cxx
+++ b/testSystemTools.cxx
@@ -204,6 +204,14 @@ static bool CheckFileOperations()
       << testNewDir << std::endl;
     res = false;
     }
+  // check existence
+  if (!kwsys::SystemTools::PathExists(testNewDir))
+    {
+    std::cerr
+      << "Problem with PathExists for: "
+      << testNewDir << std::endl;
+    res = false;
+    }
   // remove it
   if (!kwsys::SystemTools::RemoveADirectory(testNewDir))
     {
@@ -221,6 +229,15 @@ static bool CheckFileOperations()
       << testNewDir << std::endl;
     res = false;
     }
+  // check existence
+  if (kwsys::SystemTools::PathExists(testNewDir))
+    {
+    std::cerr
+      << "After RemoveADirectory: "
+      << "Problem with PathExists for: "
+      << testNewDir << std::endl;
+    res = false;
+    }
   // create it using the char* version
   if (!kwsys::SystemTools::MakeDirectory(testNewDir.c_str()))
     {
@@ -329,6 +346,31 @@ static bool CheckFileOperations()
     res = false;
     }
 
+  // calling with an empty string should return false
+  if (kwsys::SystemTools::PathExists(std::string()))
+    {
+    std::cerr
+      << "Problem with PathExists(std::string())"
+      << std::endl;
+    res = false;
+    }
+  // PathExists(x) should return true on a directory
+  if (!kwsys::SystemTools::PathExists(testNewDir))
+    {
+    std::cerr
+      << "Problem with PathExists for: "
+      << testNewDir << std::endl;
+    res = false;
+    }
+  // should work, was created as new file before
+  if (!kwsys::SystemTools::PathExists(testNewFile))
+    {
+    std::cerr
+      << "Problem with PathExists for: "
+      << testNewDir << std::endl;
+    res = false;
+    }
+
   // Reset umask
 #if defined(_WIN32) && !defined(__CYGWIN__)
   // NOTE:  Windows doesn't support toggling _S_IREAD.