summaryrefslogtreecommitdiffstats
path: root/Source/cmFindBase.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFindBase.cxx')
-rw-r--r--Source/cmFindBase.cxx30
1 files changed, 26 insertions, 4 deletions
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index e1188d5..d0fe99f 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -13,11 +13,17 @@
cmFindBase::cmFindBase()
{
- cmSystemTools::ReplaceString(this->GenericDocumentationPathsOrder,
- "FIND_ARGS_XXX", "<VAR> NAMES name");
this->AlreadyInCache = false;
this->AlreadyInCacheWithoutMetaInfo = false;
- this->GenericDocumentation =
+}
+
+//----------------------------------------------------------------------------
+void cmFindBase::GenerateDocumentation()
+{
+ this->cmFindCommon::GenerateDocumentation();
+ cmSystemTools::ReplaceString(this->GenericDocumentationPathsOrder,
+ "FIND_ARGS_XXX", "<VAR> NAMES name");
+ this->GenericDocumentation =
" FIND_XXX(<VAR> name1 [path1 path2 ...])\n"
"This is the short-hand signature for the command that "
"is sufficient in many cases. It is the same "
@@ -97,7 +103,18 @@ cmFindBase::cmFindBase()
this->GenericDocumentation += this->GenericDocumentationRootPath;
this->GenericDocumentation += this->GenericDocumentationPathsOrder;
}
-
+
+//----------------------------------------------------------------------------
+const char* cmFindBase::GetFullDocumentation()
+{
+ if(this->GenericDocumentation.empty())
+ {
+ this->GenerateDocumentation();
+ }
+ return this->GenericDocumentation.c_str();
+}
+
+//----------------------------------------------------------------------------
bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
{
if(argsIn.size() < 2 )
@@ -147,6 +164,11 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
}
}
}
+ if(args.size() < 2 )
+ {
+ this->SetError("called with incorrect number of arguments");
+ return false;
+ }
this->VariableName = args[0];
if(this->CheckForVariableInCache())
{