From e5ed57ec18e1cd1d460bd77391db15a5d4afdcc1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 7 Jul 2003 21:52:10 -0400 Subject: [PATCH] ENH: Registered global generators are now kept in a table in the cmake instance. Added support for documentation with a Generators section. --- Source/cmDocumentation.cxx | 23 +++++ Source/cmDocumentation.h | 4 + Source/cmGlobalBorlandMakefileGenerator.cxx | 9 ++ Source/cmGlobalBorlandMakefileGenerator.h | 7 +- Source/cmGlobalCodeWarriorGenerator.cxx | 9 ++ Source/cmGlobalCodeWarriorGenerator.h | 7 +- Source/cmGlobalGenerator.cxx | 7 ++ Source/cmGlobalGenerator.h | 5 +- Source/cmGlobalNMakeMakefileGenerator.cxx | 8 ++ Source/cmGlobalNMakeMakefileGenerator.h | 6 +- Source/cmGlobalUnixMakefileGenerator.cxx | 7 ++ Source/cmGlobalUnixMakefileGenerator.h | 7 +- Source/cmGlobalVisualStudio6Generator.cxx | 8 ++ Source/cmGlobalVisualStudio6Generator.h | 6 +- Source/cmGlobalVisualStudio71Generator.cxx | 8 +- Source/cmGlobalVisualStudio71Generator.h | 7 +- Source/cmGlobalVisualStudio7Generator.cxx | 8 ++ Source/cmGlobalVisualStudio7Generator.h | 7 +- Source/cmake.cxx | 101 ++++++++++---------- Source/cmake.h | 5 + Source/cmakemain.cxx | 3 + 21 files changed, 193 insertions(+), 59 deletions(-) diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 121afc794..0e853d98c 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -44,6 +44,14 @@ static const cmDocumentationEntry cmDocumentationCommandsHeader[] = {0,0,0} }; +//---------------------------------------------------------------------------- +static const cmDocumentationEntry cmDocumentationGeneratorsHeader[] = +{ + {0, + "The following generators are available on this platform:", 0}, + {0,0,0} +}; + //---------------------------------------------------------------------------- const cmDocumentationEntry cmDocumentationMailingList[] = { @@ -259,6 +267,13 @@ void cmDocumentation::SetCommandsSection(const cmDocumentationEntry* section) this->CommandsSection); } +//---------------------------------------------------------------------------- +void cmDocumentation::SetGeneratorsSection(const cmDocumentationEntry* section) +{ + this->SetSection(cmDocumentationGeneratorsHeader, section, 0, + this->GeneratorsSection); +} + //---------------------------------------------------------------------------- void cmDocumentation::PrintSection(std::ostream& os, const cmDocumentationEntry* section, @@ -720,6 +735,10 @@ void cmDocumentation::CreateFullDocumentation() { this->AddSection(0, &this->DescriptionSection[0]); } + if(!this->GeneratorsSection.empty()) + { + this->AddSection("Generators", &this->GeneratorsSection[0]); + } if(!this->OptionsSection.empty()) { this->AddSection("Command-Line Options", &this->OptionsSection[0]); @@ -748,6 +767,10 @@ void cmDocumentation::CreateManDocumentation() { this->AddSection("DESCRIPTION", &this->DescriptionSection[0]); } + if(!this->GeneratorsSection.empty()) + { + this->AddSection("GENERATORS", &this->GeneratorsSection[0]); + } if(!this->OptionsSection.empty()) { this->AddSection("OPTIONS", &this->OptionsSection[0]); diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index 5e507a0f4..b5cf85c68 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -56,6 +56,9 @@ public: /** Set the listfile commands for standard document generation. */ void SetCommandsSection(const cmDocumentationEntry*); + /** Set the generator descriptions for standard document generation. */ + void SetGeneratorsSection(const cmDocumentationEntry*); + // Low-level interface for custom documents: /** Forms of documentation output. */ @@ -124,6 +127,7 @@ private: std::vector DescriptionSection; std::vector OptionsSection; std::vector CommandsSection; + std::vector GeneratorsSection; std::vector< const char* > Names; std::vector< const cmDocumentationEntry* > Sections; diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index baf8807a2..5d9b6c350 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -58,3 +58,12 @@ cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator() lg->SetGlobalGenerator(this); return lg; } + + +//---------------------------------------------------------------------------- +void cmGlobalBorlandMakefileGenerator::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.name = this->GetName(); + entry.brief = "Generates Borland makefiles."; + entry.full = ""; +} diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h index 7f66932c5..6f5b64e41 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.h +++ b/Source/cmGlobalBorlandMakefileGenerator.h @@ -28,11 +28,16 @@ class cmGlobalBorlandMakefileGenerator : public cmGlobalNMakeMakefileGenerator { public: cmGlobalBorlandMakefileGenerator(); + static cmGlobalGenerator* New() { return new cmGlobalBorlandMakefileGenerator; } + ///! Get the name for the generator. - virtual const char* GetName() { + virtual const char* GetName() const { return cmGlobalBorlandMakefileGenerator::GetActualName();} static const char* GetActualName() {return "Borland Makefiles";} + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalCodeWarriorGenerator.cxx b/Source/cmGlobalCodeWarriorGenerator.cxx index 828199d3a..91ff5b3e3 100644 --- a/Source/cmGlobalCodeWarriorGenerator.cxx +++ b/Source/cmGlobalCodeWarriorGenerator.cxx @@ -287,3 +287,12 @@ void cmGlobalCodeWarriorGenerator::LocalGenerate() { this->cmGlobalGenerator::LocalGenerate(); } + + +//---------------------------------------------------------------------------- +void cmGlobalCodeWarriorGenerator::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.name = this->GetName(); + entry.brief = "Generates CodeWarrior project files."; + entry.full = ""; +} diff --git a/Source/cmGlobalCodeWarriorGenerator.h b/Source/cmGlobalCodeWarriorGenerator.h index 2981efd6c..d4859adcb 100644 --- a/Source/cmGlobalCodeWarriorGenerator.h +++ b/Source/cmGlobalCodeWarriorGenerator.h @@ -29,11 +29,16 @@ class cmTarget; class cmGlobalCodeWarriorGenerator : public cmGlobalGenerator { public: + static cmGlobalGenerator* New() { return new cmGlobalCodeWarriorGenerator; } + ///! Get the name for the generator. - virtual const char* GetName() { + virtual const char* GetName() const { return cmGlobalCodeWarriorGenerator::GetActualName();} static const char* GetActualName() {return "Code Warrior Not Working";} + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 669963851..48251f171 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -519,3 +519,10 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen ) } } +//---------------------------------------------------------------------------- +void cmGlobalGenerator::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.name = this->GetName(); + entry.brief = ""; + entry.full = ""; +} diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 8b9176cb3..54efa7647 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -41,7 +41,10 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); ///! Get the name for this generator - virtual const char *GetName() { return "Generic"; }; + virtual const char *GetName() const { return "Generic"; }; + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; /** * Create LocalGenerators and process the CMakeLists files. This does not diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx index abf34262c..a1db99fc3 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.cxx +++ b/Source/cmGlobalNMakeMakefileGenerator.cxx @@ -42,3 +42,11 @@ cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator() lg->SetGlobalGenerator(this); return lg; } + +//---------------------------------------------------------------------------- +void cmGlobalNMakeMakefileGenerator::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.name = this->GetName(); + entry.brief = "Generates NMake makefiles."; + entry.full = ""; +} diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h index 1c233c6c3..4647c2dc4 100644 --- a/Source/cmGlobalNMakeMakefileGenerator.h +++ b/Source/cmGlobalNMakeMakefileGenerator.h @@ -28,11 +28,15 @@ class cmGlobalNMakeMakefileGenerator : public cmGlobalUnixMakefileGenerator { public: cmGlobalNMakeMakefileGenerator(); + static cmGlobalGenerator* New() { return new cmGlobalNMakeMakefileGenerator; } ///! Get the name for the generator. - virtual const char* GetName() { + virtual const char* GetName() const { return cmGlobalNMakeMakefileGenerator::GetActualName();} static const char* GetActualName() {return "NMake Makefiles";} + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalUnixMakefileGenerator.cxx b/Source/cmGlobalUnixMakefileGenerator.cxx index d11954e24..1a71cc431 100644 --- a/Source/cmGlobalUnixMakefileGenerator.cxx +++ b/Source/cmGlobalUnixMakefileGenerator.cxx @@ -94,3 +94,10 @@ cmLocalGenerator *cmGlobalUnixMakefileGenerator::CreateLocalGenerator() return lg; } +//---------------------------------------------------------------------------- +void cmGlobalUnixMakefileGenerator::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.name = this->GetName(); + entry.brief = "Generates standard UNIX makefiles."; + entry.full = "full UNIX!"; +} diff --git a/Source/cmGlobalUnixMakefileGenerator.h b/Source/cmGlobalUnixMakefileGenerator.h index 43abe5716..77a781edd 100644 --- a/Source/cmGlobalUnixMakefileGenerator.h +++ b/Source/cmGlobalUnixMakefileGenerator.h @@ -28,11 +28,16 @@ class cmGlobalUnixMakefileGenerator : public cmGlobalGenerator { public: cmGlobalUnixMakefileGenerator(); + static cmGlobalGenerator* New() { return new cmGlobalUnixMakefileGenerator; } + ///! Get the name for the generator. - virtual const char* GetName() { + virtual const char* GetName() const { return cmGlobalUnixMakefileGenerator::GetActualName();} static const char* GetActualName() {return "Unix Makefiles";} + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 2189679b3..233a9e2c9 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -447,3 +447,11 @@ void cmGlobalVisualStudio6Generator::WriteDSWHeader(std::ostream& fout) fout << "Microsoft Developer Studio Workspace File, Format Version 6.00\n"; fout << "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n\n"; } + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio6Generator::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.name = this->GetName(); + entry.brief = "Generates Visual Studio 6 project files."; + entry.full = ""; +} diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h index be2dfd992..4df1a7068 100644 --- a/Source/cmGlobalVisualStudio6Generator.h +++ b/Source/cmGlobalVisualStudio6Generator.h @@ -30,12 +30,16 @@ class cmGlobalVisualStudio6Generator : public cmGlobalGenerator { public: cmGlobalVisualStudio6Generator(); + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio6Generator; } ///! Get the name for the generator. - virtual const char* GetName() { + virtual const char* GetName() const { return cmGlobalVisualStudio6Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 6";} + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 456490150..09b73921a 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -282,4 +282,10 @@ void cmGlobalVisualStudio71Generator::WriteSLNHeader(std::ostream& fout) fout << "Microsoft Visual Studio Solution File, Format Version 8.00\n"; } - +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio71Generator::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.name = this->GetName(); + entry.brief = "Generates Visual Studio .NET 2003 project files."; + entry.full = ""; +} diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h index 306ad9b0b..6acb56203 100644 --- a/Source/cmGlobalVisualStudio71Generator.h +++ b/Source/cmGlobalVisualStudio71Generator.h @@ -29,11 +29,16 @@ class cmGlobalVisualStudio71Generator : public cmGlobalVisualStudio7Generator { public: cmGlobalVisualStudio71Generator(); + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio71Generator; } + ///! Get the name for the generator. - virtual const char* GetName() { + virtual const char* GetName() const { return cmGlobalVisualStudio71Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 7 .NET 2003";} + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index c7d0324ed..4486f3c3a 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -584,3 +584,11 @@ std::vector *cmGlobalVisualStudio7Generator::GetConfigurations() { return &m_Configurations; }; + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio7Generator::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.name = this->GetName(); + entry.brief = "Generates Visual Studio .NET 2002 project files."; + entry.full = ""; +} diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index c703bea13..a268a44bd 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -30,14 +30,19 @@ class cmGlobalVisualStudio7Generator : public cmGlobalGenerator { public: cmGlobalVisualStudio7Generator(); + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio7Generator; } + ///! Get the name for the generator. - virtual const char* GetName() { + virtual const char* GetName() const { return cmGlobalVisualStudio7Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 7";} ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + /** * Try to determine system infomation such as shared library * extension, pthreads, byte order etc. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 22e747f79..f0732711c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -94,6 +94,7 @@ cmake::cmake() m_ProgressCallbackClientData = 0; m_VariableWatch = new cmVariableWatch; + this->AddDefaultGenerators(); this->AddDefaultCommands(); m_VariableWatch->AddWatch("CMAKE_WORDS_BIGENDIAN", @@ -662,64 +663,26 @@ int cmake::CMakeCommand(std::vector& args) void cmake::GetRegisteredGenerators(std::vector& names) { -#if defined(_WIN32) && !defined(__CYGWIN__) - names.push_back(cmGlobalVisualStudio6Generator::GetActualName()); - names.push_back(cmGlobalVisualStudio7Generator::GetActualName()); - names.push_back(cmGlobalVisualStudio71Generator::GetActualName()); - names.push_back(cmGlobalBorlandMakefileGenerator::GetActualName()); - names.push_back(cmGlobalNMakeMakefileGenerator::GetActualName()); -#else -#if defined(__APPLE__) && defined(CMAKE_BUILD_WITH_CMAKE) - names.push_back(cmGlobalCodeWarriorGenerator::GetActualName()); -#endif - names.push_back(cmGlobalUnixMakefileGenerator::GetActualName()); -#endif + for(RegisteredGeneratorsMap::const_iterator i = m_Generators.begin(); + i != m_Generators.end(); ++i) + { + names.push_back(i->first); + } } cmGlobalGenerator* cmake::CreateGlobalGenerator(const char* name) { - cmGlobalGenerator *ret = 0; -#if defined(_WIN32) && !defined(__CYGWIN__) - if (!strcmp(name,cmGlobalNMakeMakefileGenerator::GetActualName())) + RegisteredGeneratorsMap::const_iterator i = m_Generators.find(name); + if(i != m_Generators.end()) { - ret = new cmGlobalNMakeMakefileGenerator; - ret->SetCMakeInstance(this); + cmGlobalGenerator* generator = (i->second)(); + generator->SetCMakeInstance(this); + return generator; } - if (!strcmp(name,cmGlobalVisualStudio6Generator::GetActualName())) + else { - ret = new cmGlobalVisualStudio6Generator; - ret->SetCMakeInstance(this); + return 0; } - if (!strcmp(name,cmGlobalVisualStudio7Generator::GetActualName())) - { - ret = new cmGlobalVisualStudio7Generator; - ret->SetCMakeInstance(this); - } - if (!strcmp(name,cmGlobalVisualStudio71Generator::GetActualName())) - { - ret = new cmGlobalVisualStudio71Generator; - ret->SetCMakeInstance(this); - } - if (!strcmp(name,cmGlobalBorlandMakefileGenerator::GetActualName())) - { - ret = new cmGlobalBorlandMakefileGenerator; - ret->SetCMakeInstance(this); - } -#else -#if defined(__APPLE__) && defined(CMAKE_BUILD_WITH_CMAKE) - if (!strcmp(name,cmGlobalCodeWarriorGenerator::GetActualName())) - { - ret = new cmGlobalCodeWarriorGenerator; - ret->SetCMakeInstance(this); - } -#endif - if (!strcmp(name,cmGlobalUnixMakefileGenerator::GetActualName())) - { - ret = new cmGlobalUnixMakefileGenerator; - ret->SetCMakeInstance(this); - } -#endif - return ret; } void cmake::SetHomeDirectory(const char* dir) @@ -1126,6 +1089,29 @@ void cmake::AddDefaultCommands() } } +void cmake::AddDefaultGenerators() +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + m_Generators[cmGlobalVisualStudio6Generator::GetActualName()] = + &cmGlobalVisualStudio6Generator::New; + m_Generators[cmGlobalVisualStudio7Generator::GetActualName()] = + &cmGlobalVisualStudio7Generator::New; + m_Generators[cmGlobalVisualStudio71Generator::GetActualName()] = + &cmGlobalVisualStudio71Generator::New; + m_Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = + &cmGlobalBorlandMakefileGenerator::New; + m_Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] = + &cmGlobalNMakeMakefileGenerator::New; +#else +# if defined(__APPLE__) && defined(CMAKE_BUILD_WITH_CMAKE) + m_Generators[cmGlobalCodeWarriorGenerator::GetActualName()] = + &cmGlobalCodeWarriorGenerator::New; +# endif + m_Generators[cmGlobalUnixMakefileGenerator::GetActualName()] = + &cmGlobalUnixMakefileGenerator::New; +#endif +} + int cmake::LoadCache() { m_CacheManager->LoadCache(this->GetHomeOutputDirectory()); @@ -1188,3 +1174,18 @@ void cmake::GetCommandDocumentation(std::vector& v) const cmDocumentationEntry empty = {0,0,0}; v.push_back(empty); } + +void cmake::GetGeneratorDocumentation(std::vector& v) +{ + for(RegisteredGeneratorsMap::const_iterator i = m_Generators.begin(); + i != m_Generators.end(); ++i) + { + cmDocumentationEntry e; + cmGlobalGenerator* generator = (i->second)(); + generator->GetDocumentation(e); + delete generator; + v.push_back(e); + } + cmDocumentationEntry empty = {0,0,0}; + v.push_back(empty); +} diff --git a/Source/cmake.h b/Source/cmake.h index f01c0656c..35c3c3ffc 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -235,14 +235,19 @@ class cmake cmVariableWatch* GetVariableWatch() { return m_VariableWatch; } void GetCommandDocumentation(std::vector&) const; + void GetGeneratorDocumentation(std::vector&); ///! Do all the checks before running configure int DoPreConfigureChecks(); protected: + typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)(); typedef std::map RegisteredCommandsMap; + typedef std::map RegisteredGeneratorsMap; RegisteredCommandsMap m_Commands; + RegisteredGeneratorsMap m_Generators; void AddDefaultCommands(); + void AddDefaultGenerators(); cmGlobalGenerator *m_GlobalGenerator; cmCacheManager *m_CacheManager; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 299a954c4..0d3589465 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -98,10 +98,13 @@ int do_cmake(int ac, char** av) // Construct and print requested documentation. cmake hcm; std::vector commands; + std::vector generators; hcm.GetCommandDocumentation(commands); + hcm.GetGeneratorDocumentation(generators); doc.SetNameSection(cmDocumentationName); doc.SetUsageSection(cmDocumentationUsage); doc.SetDescriptionSection(cmDocumentationDescription); + doc.SetGeneratorsSection(&generators[0]); doc.SetOptionsSection(cmDocumentationOptions); doc.SetCommandsSection(&commands[0]); doc.PrintDocumentation(ht, std::cout);