diff options
author | Sebastien Barre <sebastien.barre@kitware.com> | 2001-05-11 16:13:14 (GMT) |
---|---|---|
committer | Sebastien Barre <sebastien.barre@kitware.com> | 2001-05-11 16:13:14 (GMT) |
commit | fb35c19d30141ddfa8fa666f74615a8b812132c2 (patch) | |
tree | ba00b729afa8f5e10ec74d3b7392eb867751589a /Source/cmFindLibraryCommand.cxx | |
parent | 6edfd1104c0da4b5712e30ff609cbc33256d0168 (diff) | |
download | CMake-fb35c19d30141ddfa8fa666f74615a8b812132c2.zip CMake-fb35c19d30141ddfa8fa666f74615a8b812132c2.tar.gz CMake-fb35c19d30141ddfa8fa666f74615a8b812132c2.tar.bz2 |
Fix help string when NAMES was used
Diffstat (limited to 'Source/cmFindLibraryCommand.cxx')
-rw-r--r-- | Source/cmFindLibraryCommand.cxx | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 84959dc..8aee6e4 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -49,34 +49,7 @@ bool cmFindLibraryCommand::Invoke(std::vector<std::string>& args) this->SetError("called with incorrect number of arguments"); return false; } - // Now check and see if the value has been stored in the cache - // already, if so use that value and don't look for the program - std::string helpString = "Where can the "; - if(args[1] == "NAMES") - { - for(unsigned int i=2; (args[i] != "PATHS" && i < args.size()); ++i) - { - helpString = "( "; - helpString += args[i]; - helpString += " "; - } - } - else - { - helpString += args[1]; - } - helpString += " library be found"; - const char* cacheValue - = cmCacheManager::GetInstance()->GetCacheValue(args[0].c_str()); - if(cacheValue && strcmp(cacheValue, "NOTFOUND")) - { - m_Makefile->AddDefinition(args[0].c_str(), cacheValue); - cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(), - cacheValue, - helpString.c_str(), - cmCacheManager::FILEPATH); - return true; - } + std::vector<std::string> path; std::vector<std::string> names; bool foundName = false; @@ -124,6 +97,34 @@ bool cmFindLibraryCommand::Invoke(std::vector<std::string>& args) path.push_back(exp); } } + + std::string helpString = "Where can "; + if (names.size() == 1) + { + helpString += "the " + names[0] + " library be found"; + } + else + { + helpString += "one of the " + names[0]; + for (unsigned int j = 1; j < names.size() - 1; ++j) + { + helpString += ", " + names[j]; + } + helpString += " or " + names[names.size() - 1] + " libraries be found"; + } + + const char* cacheValue + = cmCacheManager::GetInstance()->GetCacheValue(args[0].c_str()); + if(cacheValue && strcmp(cacheValue, "NOTFOUND")) + { + m_Makefile->AddDefinition(args[0].c_str(), cacheValue); + cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(), + cacheValue, + helpString.c_str(), + cmCacheManager::FILEPATH); + return true; + } + std::string library; for(std::vector<std::string>::iterator i = names.begin(); i != names.end() ; ++i) |