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.

This commit is contained in:
Brad King 2008-02-06 15:26:22 -05:00
parent a5074872b0
commit d9b9720167
1 changed files with 10 additions and 0 deletions

View File

@ -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)