Jelajahi Sumber

ENH: Make find_library test for the library file as named before trying prefixes and suffixes. This will allow users to explicitly search for static libraries on unix. See bug #1643.

Brad King 17 tahun lalu
induk
melakukan
d9b9720167
1 mengubah file dengan 10 tambahan dan 0 penghapusan
  1. 10 0
      Source/cmFindLibraryCommand.cxx

+ 10 - 0
Source/cmFindLibraryCommand.cxx

@@ -263,6 +263,16 @@ std::string cmFindLibraryCommand::FindLibrary(const char* name)
       }
     if(!onlyFrameworks)
       {
+      // Try the original library name as specified by the user.
+      tryPath = *p;
+      tryPath += name;
+      if(cmSystemTools::FileExists(tryPath.c_str(), true))
+        {
+        tryPath = cmSystemTools::CollapseFullPath(tryPath.c_str());
+        cmSystemTools::ConvertToUnixSlashes(tryPath);
+        return tryPath;
+        }
+
       // Try various library naming conventions.
       for(std::vector<std::string>::iterator prefix = prefixes.begin();
           prefix != prefixes.end(); ++prefix)