summaryrefslogtreecommitdiffstats
path: root/Source/cmFindProgramCommand.cxx
diff options
context:
space:
mode:
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;
}