瀏覽代碼

BUG: FindLibrary should not accept a directory even if the exact specified name exists.

Brad King 22 年之前
父節點
當前提交
d9cda28701
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Source/cmSystemTools.cxx

+ 3 - 2
Source/cmSystemTools.cxx

@@ -1626,11 +1626,12 @@ std::string cmSystemTools::FindLibrary(const char* name,
                                        const std::vector<std::string>& userPaths)
 {
   // See if the executable exists as written.
-  if(cmSystemTools::FileExists(name))
+  if(cmSystemTools::FileExists(name) &&
+     !cmSystemTools::FileIsDirectory(name))
     {
     return cmSystemTools::CollapseFullPath(name);
     }
-    
+  
   // Add the system search path to our path.
   std::vector<std::string> path = userPaths;
   cmSystemTools::GetPath(path);