summaryrefslogtreecommitdiffstats
path: root/Source/cmFindProgramCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-11-26 23:24:47 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-11-26 23:24:47 (GMT)
commit3e24edcd04234c20a5c3045a7af9ff482fd61a45 (patch)
tree8b42271abfc9a7b04bdd27ecf6d678bb8672c0ad /Source/cmFindProgramCommand.cxx
parentb170d21c9893c33b44d34ed0dedc81de1baec039 (diff)
downloadCMake-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/cmFindProgramCommand.cxx')
-rw-r--r--Source/cmFindProgramCommand.cxx23
1 files changed, 20 insertions, 3 deletions
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index e6c7edc..df21da4 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -52,7 +52,24 @@ bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn)
this->SetError("called with incorrect number of arguments");
return false;
}
- std::vector<std::string> args = argsIn;
+ std::string doc = "Path to a program.";
+ 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)
+ {
+ doc = argsIn[j+1];
+ }
+ break;
+ }
+ }
std::vector<std::string>::iterator i = args.begin();
// Use the first argument as the name of something to be defined
const char* define = (*i).c_str();
@@ -125,7 +142,7 @@ bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn)
// Save the value in the cache
m_Makefile->AddCacheDefinition(define,
result.c_str(),
- "Path to a program.",
+ doc.c_str(),
cmCacheManager::FILEPATH);
return true;
@@ -133,7 +150,7 @@ bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn)
}
m_Makefile->AddCacheDefinition(args[0].c_str(),
"NOTFOUND",
- "Path to a program",
+ doc.c_str(),
cmCacheManager::FILEPATH);
return true;
}