summaryrefslogtreecommitdiff
path: root/Source/cmFindLibraryCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-04-26 09:38:31 -0400
committerKen Martin <ken.martin@kitware.com>2001-04-26 09:38:31 -0400
commit30ad61805bbb5b34e2bf17cb36ce2e9601ed0f25 (patch)
tree5b3fcc1f4f7c87868910d1714f9d08ede81afbd0 /Source/cmFindLibraryCommand.cxx
parentab7f884a444d929c5598a8384526e5f4044bc515 (diff)
downloadcmake-30ad61805bbb5b34e2bf17cb36ce2e9601ed0f25.tar.gz
bug fixes
Diffstat (limited to 'Source/cmFindLibraryCommand.cxx')
-rw-r--r--Source/cmFindLibraryCommand.cxx35
1 files changed, 32 insertions, 3 deletions
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 1504af685e..6587f06833 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -19,7 +19,7 @@
// cmFindLibraryCommand
bool cmFindLibraryCommand::Invoke(std::vector<std::string>& args)
{
- if(args.size() < 2 )
+ if(args.size() < 2)
{
this->SetError("called with incorrect number of arguments");
return false;
@@ -36,6 +36,7 @@ bool cmFindLibraryCommand::Invoke(std::vector<std::string>& args)
}
return true;
}
+
std::vector<std::string> path;
// add any user specified paths
for (unsigned int j = 2; j < args.size(); j++)
@@ -53,8 +54,36 @@ bool cmFindLibraryCommand::Invoke(std::vector<std::string>& args)
{
std::string tryPath = path[k];
tryPath += "/";
- tryPath += args[1];
- if(cmSystemTools::FileExists(tryPath.c_str()))
+ std::string testF;
+ testF = tryPath + args[1] + ".lib";
+ if(cmSystemTools::FileExists(testF.c_str()))
+ {
+ m_Makefile->AddDefinition(args[0].c_str(), path[k].c_str());
+ cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),
+ path[k].c_str(),
+ cmCacheManager::PATH);
+ return true;
+ }
+ testF = tryPath + "lib" + args[1] + ".so";
+ if(cmSystemTools::FileExists(testF.c_str()))
+ {
+ m_Makefile->AddDefinition(args[0].c_str(), path[k].c_str());
+ cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),
+ path[k].c_str(),
+ cmCacheManager::PATH);
+ return true;
+ }
+ testF = tryPath + "lib" + args[1] + ".a";
+ if(cmSystemTools::FileExists(testF.c_str()))
+ {
+ m_Makefile->AddDefinition(args[0].c_str(), path[k].c_str());
+ cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),
+ path[k].c_str(),
+ cmCacheManager::PATH);
+ return true;
+ }
+ testF = tryPath + "lib" + args[1] + ".sl";
+ if(cmSystemTools::FileExists(testF.c_str()))
{
m_Makefile->AddDefinition(args[0].c_str(), path[k].c_str());
cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),