summaryrefslogtreecommitdiffstats
path: root/Source/cmFindBase.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-11-12 15:47:28 (GMT)
committerBrad King <brad.king@kitware.com>2010-11-12 15:47:28 (GMT)
commit5303fbf09ebf3ca18983bf2c556767d16a4ff677 (patch)
treedff2c0396ce5c2dab01861308802e1ee08948dd5 /Source/cmFindBase.cxx
parente6975fe82fc682a47739f3fad695610f045447ae (diff)
downloadCMake-5303fbf09ebf3ca18983bf2c556767d16a4ff677.zip
CMake-5303fbf09ebf3ca18983bf2c556767d16a4ff677.tar.gz
CMake-5303fbf09ebf3ca18983bf2c556767d16a4ff677.tar.bz2
Speedup find_* commands (#11412)
Delay computation of the command documentation until it is needed. It is wasteful to do it in the constructor on every call. Inspired-By: Christian Ehrlicher <Ch.Ehrlicher@gmx.de>
Diffstat (limited to 'Source/cmFindBase.cxx')
-rw-r--r--Source/cmFindBase.cxx25
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index e1188d5..0416538 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 )