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/cmFindFileCommand.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/cmFindFileCommand.cxx')
-rw-r--r-- | Source/cmFindFileCommand.cxx | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/Source/cmFindFileCommand.cxx b/Source/cmFindFileCommand.cxx index d919788..71f73a8 100644 --- a/Source/cmFindFileCommand.cxx +++ b/Source/cmFindFileCommand.cxx @@ -45,22 +45,38 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // cmFindFileCommand -bool cmFindFileCommand::InitialPass(std::vector<std::string> const& args) +bool cmFindFileCommand::InitialPass(std::vector<std::string> const& argsIn) { - if(args.size() < 2) + if(argsIn.size() < 2) { this->SetError("called with incorrect number of arguments"); return false; } - + std::string helpString = "Where can the "; + helpString += argsIn[1] + " file be found"; + 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>::const_iterator i = args.begin(); // Use the first argument as the name of something to be defined const char* define = (*i).c_str(); i++; // move iterator to next arg // 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 "; - helpString += args[1] + " file be found"; const char* cacheValue = m_Makefile->GetDefinition(define); if(cacheValue && strcmp(cacheValue, "NOTFOUND")) |