summaryrefslogtreecommitdiffstats
path: root/Source/cmFindLibraryCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-02-06 20:26:22 (GMT)
committerBrad King <brad.king@kitware.com>2008-02-06 20:26:22 (GMT)
commitd9b97201670de2867483858794ba80b52cea1d66 (patch)
treeea63af41d7e722d346ba83b68188566504a76d24 /Source/cmFindLibraryCommand.cxx
parenta5074872b070ff1675a64bda78f5e6d2d29315c3 (diff)
downloadCMake-d9b97201670de2867483858794ba80b52cea1d66.zip
CMake-d9b97201670de2867483858794ba80b52cea1d66.tar.gz
CMake-d9b97201670de2867483858794ba80b52cea1d66.tar.bz2
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.
Diffstat (limited to 'Source/cmFindLibraryCommand.cxx')
-rw-r--r--Source/cmFindLibraryCommand.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 6b8b105..b221160 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/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)