diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-11-26 23:24:47 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-11-26 23:24:47 (GMT) |
commit | 3e24edcd04234c20a5c3045a7af9ff482fd61a45 (patch) | |
tree | 8b42271abfc9a7b04bdd27ecf6d678bb8672c0ad /Source/cmFindLibraryCommand.cxx | |
parent | b170d21c9893c33b44d34ed0dedc81de1baec039 (diff) | |
download | CMake-3e24edcd04234c20a5c3045a7af9ff482fd61a45.zip CMake-3e24edcd04234c20a5c3045a7af9ff482fd61a45.tar.gz CMake-3e24edcd04234c20a5c3045a7af9ff482fd61a45.tar.bz2 |
ENH: add possibility to add doc strings to varibles created by find type commands
Diffstat (limited to 'Source/cmFindLibraryCommand.cxx')
-rw-r--r-- | Source/cmFindLibraryCommand.cxx | 55 |
1 files changed, 37 insertions, 18 deletions
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx index 5e374f2..36075e9 100644 --- a/Source/cmFindLibraryCommand.cxx +++ b/Source/cmFindLibraryCommand.cxx @@ -44,11 +44,28 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // cmFindLibraryCommand bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn) { - std::vector<std::string> args = argsIn; - if(args.size() < 2) + if(argsIn.size() < 2) { this->SetError("called with incorrect number of arguments"); return false; + } + std::string helpString; + unsigned int size = argsIn.size(); + std::vector<std::string> args; + for(unsigned int j = 0; j < size; ++j) + { + if(argsIn[j] != "DOC") + { + args.push_back(argsIn[j]); + } + else + { + if(j+1 < size) + { + helpString = argsIn[j+1]; + } + break; + } } std::vector<std::string> path; @@ -101,26 +118,28 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn) cmSystemTools::GlobDirs(exp.c_str(), path); } } - - std::string helpString = "Where can "; - if (names.size() == 0) - { - helpString += "the (unknown) library be found"; - } - else if (names.size() == 1) + if(helpString.size() == 0) { - 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 = "Where can "; + if (names.size() == 0) + { + helpString += "the (unknown) library be found"; + } + else if (names.size() == 1) + { + helpString += "the " + names[0] + " library be found"; + } + else { - helpString += ", " + names[j]; + 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"; } - helpString += " or " + names[names.size() - 1] + " libraries be found"; } - + const char* cacheValue = m_Makefile->GetDefinition(args[0].c_str()); if(cacheValue && strcmp(cacheValue, "NOTFOUND")) |