ENH: Add generators documentation

This commit is contained in:
Andy Cedilnik 2006-05-02 17:52:22 -04:00
parent 7e788fed35
commit 6597cc4808
3 changed files with 40 additions and 6 deletions

View File

@ -30,13 +30,22 @@
//----------------------------------------------------------------------
cmCPackGenerators::cmCPackGenerators()
{
this->RegisterGenerator("TGZ", cmCPackTGZGenerator::CreateGenerator);
this->RegisterGenerator("STGZ", cmCPackSTGZGenerator::CreateGenerator);
this->RegisterGenerator("NSIS", cmCPackNSISGenerator::CreateGenerator);
this->RegisterGenerator("ZIP", cmCPackZIPGenerator::CreateGenerator);
this->RegisterGenerator("TZ", cmCPackTarCompressGenerator::CreateGenerator);
this->RegisterGenerator("PackageMaker",
this->RegisterGenerator("TGZ", "Tar GZip compression",
cmCPackTGZGenerator::CreateGenerator);
this->RegisterGenerator("STGZ", "Self extracting Tar GZip compression",
cmCPackSTGZGenerator::CreateGenerator);
#ifdef _WIN32
this->RegisterGenerator("NSIS", "Null Soft Installer",
cmCPackNSISGenerator::CreateGenerator);
#endif
this->RegisterGenerator("ZIP", "ZIP file format",
cmCPackZIPGenerator::CreateGenerator);
this->RegisterGenerator("TZ", "Tar Compress compression",
cmCPackTarCompressGenerator::CreateGenerator);
#ifdef __APPLE__
this->RegisterGenerator("PackageMaker", "Mac OSX Package Maker compression",
cmCPackPackageMakerGenerator::CreateGenerator);
#endif
}
//----------------------------------------------------------------------
@ -81,6 +90,7 @@ cmCPackGenericGenerator* cmCPackGenerators::NewGeneratorInternal(
//----------------------------------------------------------------------
void cmCPackGenerators::RegisterGenerator(const char* name,
const char* generatorDescription,
CreateGeneratorCall* createGenerator)
{
if ( !name || !createGenerator )
@ -90,4 +100,5 @@ void cmCPackGenerators::RegisterGenerator(const char* name,
return;
}
this->GeneratorCreators[name] = createGenerator;
this->GeneratorDescriptions[name] = generatorDescription;
}

View File

@ -42,16 +42,22 @@ public:
typedef cmCPackGenericGenerator* CreateGeneratorCall();
void RegisterGenerator(const char* name,
const char* generatorDescription,
CreateGeneratorCall* createGenerator);
void SetLogger(cmCPackLog* logger) { this->Logger = logger; }
typedef std::map<cmStdString, cmStdString> DescriptionsMap;
const DescriptionsMap& GetGeneratorsList() const
{ return this->GeneratorDescriptions; }
private:
cmCPackGenericGenerator* NewGeneratorInternal(const char* name);
std::vector<cmCPackGenericGenerator*> Generators;
typedef std::map<cmStdString, CreateGeneratorCall*> t_GeneratorCreatorsMap;
t_GeneratorCreatorsMap GeneratorCreators;
DescriptionsMap GeneratorDescriptions;
cmCPackLog* Logger;
};

View File

@ -376,6 +376,23 @@ int main (int argc, char *argv[])
doc.SetUsageSection(cmDocumentationUsage);
doc.SetDescriptionSection(cmDocumentationDescription);
doc.SetOptionsSection(cmDocumentationOptions);
std::vector<cmDocumentationEntry> v;
cmCPackGenerators::DescriptionsMap::const_iterator generatorIt;
for( generatorIt = generators.GetGeneratorsList().begin();
generatorIt != generators.GetGeneratorsList().end();
++ generatorIt )
{
cmDocumentationEntry e;
e.name = generatorIt->first.c_str();
e.brief = generatorIt->second.c_str();
e.full = "";
v.push_back(e);
}
cmDocumentationEntry empty = {0,0,0};
v.push_back(empty);
doc.SetGeneratorsSection(&v[0]);
doc.SetSeeAlsoList(cmDocumentationSeeAlso);
#undef cout
return doc.PrintRequestedDocumentation(std::cout)? 0:1;