diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-04-26 13:38:31 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-04-26 13:38:31 (GMT) |
commit | 30ad61805bbb5b34e2bf17cb36ce2e9601ed0f25 (patch) | |
tree | 5b3fcc1f4f7c87868910d1714f9d08ede81afbd0 /Source/cmFindLibraryCommand.cxx | |
parent | ab7f884a444d929c5598a8384526e5f4044bc515 (diff) | |
download | CMake-30ad61805bbb5b34e2bf17cb36ce2e9601ed0f25.zip CMake-30ad61805bbb5b34e2bf17cb36ce2e9601ed0f25.tar.gz CMake-30ad61805bbb5b34e2bf17cb36ce2e9601ed0f25.tar.bz2 |
bug fixes
Diffstat (limited to 'Source/cmFindLibraryCommand.cxx')
-rw-r--r-- | Source/cmFindLibraryCommand.cxx | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 1504af6..6587f06 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(), |