Commit 87cc62ca authored by Brad King's avatar Brad King
Browse files

Drop "full" documentation output types

We will no longer support full documentation generation from executables
and will instead generate documentation with other tools.  Disable (with
a warning left behind) the command-line options:

 --copyright
 --help-compatcommands
 --help-full
 --help-html
 --help-man

Drop supporting code.  Drop manual sections generation from executables.
Remove internal documentation construction APIs.  Drop unused sections
See Also, Author, Copyright, Compat Commands, Custom Modules.
parent 441f2808
......@@ -499,7 +499,6 @@ set(CPACK_SRCS
CPack/cmCPackTarCompressGenerator.cxx
CPack/cmCPackZIPGenerator.cxx
CPack/cmCPackDocumentVariables.cxx
CPack/cmCPackDocumentMacros.cxx
)
if(CYGWIN)
......
#include "cmCPackDocumentMacros.h"
void cmCPackDocumentMacros::GetMacrosDocumentation(
std::vector<cmDocumentationEntry>& )
{
// Commented-out example of use
//
// cmDocumentationEntry e("cpack_<macro>",
// "Brief Description"
// "which may be on several lines.",
// "Long description in pre-formatted format"
// " blah\n"
// " blah\n"
//);
//v.push_back(e);
}
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#ifndef cmCPackDocumentMacros_h
#define cmCPackDocumentMacros_h
#include "cmStandardIncludes.h"
class cmCPackDocumentMacros
{
public:
static void GetMacrosDocumentation(std::vector<cmDocumentationEntry>& v);
};
#endif
......@@ -15,7 +15,6 @@
#include "cmake.h"
#include "cmDocumentation.h"
#include "cmCPackDocumentVariables.h"
#include "cmCPackDocumentMacros.h"
#include "cmCPackGeneratorFactory.h"
#include "cmCPackGenerator.h"
#include "cmake.h"
......@@ -45,18 +44,6 @@ static const char * cmDocumentationUsage[][3] =
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationDescription[][3] =
{
{0,
"The \"cpack\" executable is the CMake packaging program. "
"CMake-generated build trees created for projects that use "
"the INSTALL_* commands have packaging support. "
"This program will generate the package.", 0},
CMAKE_STANDARD_INTRODUCTION,
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationOptions[][3] =
{
......@@ -129,14 +116,6 @@ static const char * cmDocumentationOptions[][3] =
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationSeeAlso[][3] =
{
{0, "cmake", 0},
{0, "ccmake", 0},
{0, 0, 0}
};
//----------------------------------------------------------------------------
int cpackUnknownArgument(const char*, void*)
{
......@@ -533,22 +512,8 @@ int main (int argc, char *argv[])
doc.SetName("cpack");
doc.SetSection("Name",cmDocumentationName);
doc.SetSection("Usage",cmDocumentationUsage);
doc.SetSection("Description",cmDocumentationDescription);
doc.PrependSection("Options",cmDocumentationOptions);
// statically (in C++ code) defined variables
cmCPackDocumentVariables::DefineVariables(&cminst);
std::vector<cmDocumentationEntry> commands;
std::map<std::string,cmDocumentationSection *> propDocs;
cminst.GetPropertiesDocumentation(propDocs);
doc.SetSections(propDocs);
cminst.GetCommandDocumentation(commands,true,false);
// statically (in C++ code) defined macros/commands
cmCPackDocumentMacros::GetMacrosDocumentation(commands);
doc.SetSection("Commands",commands);
std::vector<cmDocumentationEntry> v;
cmCPackGeneratorFactory::DescriptionsMap::const_iterator generatorIt;
for( generatorIt = generators.GetGeneratorsList().begin();
......@@ -563,7 +528,6 @@ int main (int argc, char *argv[])
}
doc.SetSection("Generators",v);
doc.SetSeeAlsoList(cmDocumentationSeeAlso);
#undef cout
return doc.PrintRequestedDocumentation(std::cout)? 0:1;
#define cout no_cout_use_cmCPack_Log
......
......@@ -361,12 +361,6 @@ void cmCTestScriptHandler::CreateCMake()
this->AddCTestCommand(new cmCTestUploadCommand);
}
void cmCTestScriptHandler::GetCommandDocumentation(
std::vector<cmDocumentationEntry>& v) const
{
this->CMake->GetCommandDocumentation(v);
}
//----------------------------------------------------------------------
// this sets up some variables for the script to use, creates the required
// cmake instance and generators, and then reads in the script
......
......@@ -110,7 +110,6 @@ public:
void Initialize();
void CreateCMake();
void GetCommandDocumentation(std::vector<cmDocumentationEntry>& v) const;
cmake* GetCMake() { return this->CMake;}
private:
// reads in a script
......
......@@ -39,18 +39,6 @@ static const char * cmDocumentationUsage[][3] =
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationDescription[][3] =
{
{0,
"The \"ccmake\" executable is the CMake curses interface. Project "
"configuration settings may be specified interactively through "
"this GUI. Brief instructions are provided at the bottom of the "
"terminal when the program is running.", 0},
CMAKE_STANDARD_INTRODUCTION,
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationOptions[][3] =
{
......@@ -58,14 +46,6 @@ static const char * cmDocumentationOptions[][3] =
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationSeeAlso[][3] =
{
{0, "cmake", 0},
{0, "ctest", 0},
{0, 0, 0}
};
cmCursesForm* cmCursesForm::CurrentForm=0;
extern "C"
......@@ -106,21 +86,13 @@ int main(int argc, char** argv)
if(doc.CheckOptions(argc, argv))
{
cmake hcm;
std::vector<cmDocumentationEntry> commands;
std::vector<cmDocumentationEntry> compatCommands;
std::vector<cmDocumentationEntry> generators;
hcm.GetCommandDocumentation(commands, true, false);
hcm.GetCommandDocumentation(compatCommands, false, true);
hcm.GetGeneratorDocumentation(generators);
doc.SetName("ccmake");
doc.SetSection("Name",cmDocumentationName);
doc.SetSection("Usage",cmDocumentationUsage);
doc.SetSection("Description",cmDocumentationDescription);
doc.SetSection("Generators",generators);
doc.PrependSection("Options",cmDocumentationOptions);
doc.SetSection("Command",commands);
doc.SetSection("Compatibility Commands",compatCommands);
doc.SetSeeAlsoList(cmDocumentationSeeAlso);
return doc.PrintRequestedDocumentation(std::cout)? 0:1;
}
......
......@@ -40,18 +40,6 @@ static const char * cmDocumentationUsage[][3] =
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationDescription[][3] =
{
{0,
"The \"cmake-gui\" executable is the CMake GUI. Project "
"configuration settings may be specified interactively. "
"Brief instructions are provided at the bottom of the "
"window when the program is running.", 0},
CMAKE_STANDARD_INTRODUCTION,
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationOptions[][3] =
{
......@@ -76,24 +64,14 @@ int main(int argc, char** argv)
{
doc.SetCMakeRoot(root);
}
std::vector<cmDocumentationEntry> commands;
std::vector<cmDocumentationEntry> compatCommands;
std::map<std::string,cmDocumentationSection *> propDocs;
std::vector<cmDocumentationEntry> generators;
hcm.GetCommandDocumentation(commands, true, false);
hcm.GetCommandDocumentation(compatCommands, false, true);
hcm.GetGeneratorDocumentation(generators);
hcm.GetPropertiesDocumentation(propDocs);
doc.SetName("cmake");
doc.SetSection("Name",cmDocumentationName);
doc.SetSection("Usage",cmDocumentationUsage);
doc.SetSection("Description",cmDocumentationDescription);
doc.AppendSection("Generators",generators);
doc.PrependSection("Options",cmDocumentationOptions);
doc.SetSection("Commands",commands);
doc.SetSection("Compatilbility Commands", compatCommands);
doc.SetSections(propDocs);
return (doc.PrintRequestedDocumentation(std::cout)? 0:1);
}
......
......@@ -42,83 +42,6 @@ static const char *cmDocumentationStandardOptions[][3] =
{0,0,0}
};
//----------------------------------------------------------------------------
static const char *cmModulesDocumentationDescription[][3] =
{
{0,
" CMake Modules - Modules coming with CMake, the Cross-Platform Makefile "
"Generator.", 0},
// CMAKE_DOCUMENTATION_OVERVIEW,
{0,
"This is the documentation for the modules and scripts coming with CMake. "
"Using these modules you can check the computer system for "
"installed software packages, features of the compiler and the "
"existence of headers to name just a few.", 0},
{0,0,0}
};
//----------------------------------------------------------------------------
static const char *cmCustomModulesDocumentationDescription[][3] =
{
{0,
" Custom CMake Modules - Additional Modules for CMake.", 0},
// CMAKE_DOCUMENTATION_OVERVIEW,
{0,
"This is the documentation for additional modules and scripts for CMake. "
"Using these modules you can check the computer system for "
"installed software packages, features of the compiler and the "
"existence of headers to name just a few.", 0},
{0,0,0}
};
//----------------------------------------------------------------------------
static const char *cmPropertiesDocumentationDescription[][3] =
{
{0,
" CMake Properties - Properties supported by CMake, "
"the Cross-Platform Makefile Generator.", 0},
// CMAKE_DOCUMENTATION_OVERVIEW,
{0,
"This is the documentation for the properties supported by CMake. "
"Properties can have different scopes. They can either be assigned to a "
"source file, a directory, a target or globally to CMake. By modifying the "
"values of properties the behaviour of the build system can be customized.",
0},
{0,0,0}
};
//----------------------------------------------------------------------------
static const char *cmCompatCommandsDocumentationDescription[][3] =
{
{0,
" CMake Compatibility Listfile Commands - "
"Obsolete commands supported by CMake for compatibility.", 0},
// CMAKE_DOCUMENTATION_OVERVIEW,
{0,
"This is the documentation for now obsolete listfile commands from previous "
"CMake versions, which are still supported for compatibility reasons. You "
"should instead use the newer, faster and shinier new commands. ;-)", 0},
{0,0,0}
};
//----------------------------------------------------------------------------
static const char *cmDocumentationModulesHeader[][3] =
{
{0,
"The following modules are provided with CMake. "
"They can be used with INCLUDE(ModuleName).", 0},
{0,0,0}
};
//----------------------------------------------------------------------------
static const char *cmDocumentationCustomModulesHeader[][3] =
{
{0,
"The following modules are also available for CMake. "
"They can be used with INCLUDE(ModuleName).", 0},
{0,0,0}
};
//----------------------------------------------------------------------------
static const char *cmDocumentationGeneratorsHeader[][3] =
{
......@@ -127,89 +50,6 @@ static const char *cmDocumentationGeneratorsHeader[][3] =
{0,0,0}
};
//----------------------------------------------------------------------------
static const char *cmDocumentationStandardSeeAlso[][3] =
{
{0,
"The following resources are available to get help using CMake:", 0},
{"Home Page",
"http://www.cmake.org",
"The primary starting point for learning about CMake."},
{"Frequently Asked Questions",
"http://www.cmake.org/Wiki/CMake_FAQ",
"A Wiki is provided containing answers to frequently asked questions. "},
{"Online Documentation",
"http://www.cmake.org/HTML/Documentation.html",
"Links to available documentation may be found on this web page."},
{"Mailing List",
"http://www.cmake.org/HTML/MailingLists.html",
"For help and discussion about using cmake, a mailing list is provided at "
"cmake@cmake.org. "
"The list is member-post-only but one may sign up on the CMake web page. "
"Please first read the full documentation at "
"http://www.cmake.org before posting questions to the list."},
{0,0,0}
};
//----------------------------------------------------------------------------
static const char *cmDocumentationCopyright[][3] =
{
{0,
"Copyright 2000-2012 Kitware, Inc., Insight Software Consortium. "
"All rights reserved.", 0},
{0,
"Redistribution and use in source and binary forms, with or without "
"modification, are permitted provided that the following conditions are "
"met:", 0},
{"",
"Redistributions of source code must retain the above copyright notice, "
"this list of conditions and the following disclaimer.", 0},
{"",
"Redistributions in binary form must reproduce the above copyright "
"notice, this list of conditions and the following disclaimer in the "
"documentation and/or other materials provided with the distribution.",
0},
{"",
"Neither the names of Kitware, Inc., the Insight Software Consortium, "
"nor the names of their contributors may be used to endorse or promote "
"products derived from this software without specific prior written "
"permission.", 0},
{0,
"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "
"\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT "
"LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR "
"A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT "
"HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, "
"SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT "
"LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, "
"DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY "
"THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT "
"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE "
"OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
0},
{0, 0, 0}
};
//----------------------------------------------------------------------------
#define DOCUMENT_INTRO(type, default_name, desc) \
static char const *cmDocumentation##type##Intro[2] = { default_name, desc };
#define GET_DOCUMENT_INTRO(type) cmDocumentation##type##Intro
DOCUMENT_INTRO(Modules, "cmakemodules",
"Reference of available CMake modules.");
DOCUMENT_INTRO(CustomModules, "cmakecustommodules",
"Reference of available CMake custom modules.");
DOCUMENT_INTRO(Policies, "cmakepolicies",
"Reference of CMake policies.");
DOCUMENT_INTRO(Properties, "cmakeprops",
"Reference of CMake properties.");
DOCUMENT_INTRO(Variables, "cmakevars",
"Reference of CMake variables.");
DOCUMENT_INTRO(Commands, "cmakecommands",
"Reference of available CMake commands.");
DOCUMENT_INTRO(CompatCommands, "cmakecompat",
"Reference of CMake compatibility commands.");
//----------------------------------------------------------------------------
cmDocumentation::cmDocumentation()
:CurrentFormatter(0)
......@@ -222,11 +62,6 @@ cmDocumentation::cmDocumentation()
//----------------------------------------------------------------------------
cmDocumentation::~cmDocumentation()
{
for(std::vector< char* >::iterator i = this->ModuleStrings.begin();
i != this->ModuleStrings.end(); ++i)
{
delete [] *i;
}
for(std::map<std::string,cmDocumentationSection *>::iterator i =
this->AllSections.begin();
i != this->AllSections.end(); ++i)
......@@ -235,30 +70,6 @@ cmDocumentation::~cmDocumentation()
}
}
//----------------------------------------------------------------------------
bool cmDocumentation::PrintCopyright(std::ostream& os)
{
cmDocumentationSection *sec = this->AllSections["Copyright"];
const std::vector<cmDocumentationEntry> &entries = sec->GetEntries();
for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end(); ++op)
{
if(op->Name.size())
{
os << " * ";
this->TextFormatter.SetIndent(" ");
this->TextFormatter.PrintColumn(os, op->Brief.c_str());
}
else
{
this->TextFormatter.SetIndent("");
this->TextFormatter.PrintColumn(os, op->Brief.c_str());
}
os << "\n";
}
return true;
}
//----------------------------------------------------------------------------
bool cmDocumentation::PrintVersion(std::ostream& os)
{
......@@ -281,295 +92,37 @@ void cmDocumentation::ClearSections()
{
this->PrintSections.erase(this->PrintSections.begin(),
this->PrintSections.end());
this->ModulesFound.clear();
}
//----------------------------------------------------------------------------
void cmDocumentation::AddDocumentIntroToPrint(const char* intro[2])
{
const char* docname = this->GetDocName(false);
if(intro && docname)
{
cmDocumentationSection* section;
std::string desc("");
desc += docname;
desc += " - ";
desc += intro[1];
section = new cmDocumentationSection("Introduction", "NAME");
section->Append(0, desc.c_str(), 0);
this->PrintSections.push_back(section);
}
}
//----------------------------------------------------------------------------
bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os,
const char* docname)
bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os)
{
// Handle Document Name. docname==0 disables intro.
this->SetDocName("");
if (docname)
{
if (*docname)
this->SetDocName(docname);
else // empty string was given. select default if possible
this->SetDocName(this->GetDefaultDocName(ht));
}
switch (ht)
{
case cmDocumentation::Usage:
return this->PrintDocumentationUsage(os);
case cmDocumentation::Single:
return this->PrintDocumentationSingle(os);
case cmDocumentation::SingleModule:
return this->PrintDocumentationSingleModule(os);
case cmDocumentation::SinglePolicy:
return this->PrintDocumentationSinglePolicy(os);
case cmDocumentation::SingleProperty:
return this->PrintDocumentationSingleProperty(os);
case cmDocumentation::SingleVariable:
return this->PrintDocumentationSingleVariable(os);
case cmDocumentation::List:
this->PrintDocumentationList(os,"Commands");
this->PrintDocumentationList(os,"Compatibility Commands");
return true;
case cmDocumentation::ModuleList:
// find the modules first, print the custom module docs only if
// any custom modules have been found actually, Alex
this->CreateCustomModulesSection();
this->CreateModulesSection();
if (this->AllSections.find("Custom CMake Modules")
!= this->AllSections.end())
{
this->PrintDocumentationList(os,"Custom CMake Modules");
}
this->PrintDocumentationList(os,"Modules");
return true;
case cmDocumentation::PropertyList:
this->PrintDocumentationList(os,"Properties Description");
for (std::vector<std::string>::iterator i =
this->PropertySections.begin();
i != this->PropertySections.end(); ++i)
{
this->PrintDocumentationList(os,i->c_str());
}
return true;
case cmDocumentation::VariableList:
for (std::vector<std::string>::iterator i =
this->VariableSections.begin();
i != this->VariableSections.end(); ++i)
{
this->PrintDocumentationList(os,i->c_str());
}
return true;
case cmDocumentation::PolicyList:
this->PrintDocumentationList(os,"Policies");
return true;
case cmDocumentation::Full:
return this->PrintDocumentationFull(os);
case cmDocumentation::Modules:
return this->PrintDocumentationModules(os);
case cmDocumentation::CustomModules:
return this->PrintDocumentationCustomModules(os);
case cmDocumentation::Policies:
return this->PrintDocumentationPolicies(os);
case cmDocumentation::Properties:
return this->PrintDocumentationProperties(os);
case cmDocumentation::Variables:
return this->PrintDocumentationVariables(os);
case cmDocumentation::Commands:
return this->PrintDocumentationCurrentCommands(os);
case cmDocumentation::CompatCommands:
return this->PrintDocumentationCompatCommands(os);
case cmDocumentation::Copyright:
return this->PrintCopyright(os);
return false;
case cmDocumentation::Version:
return this->PrintVersion(os);
default: return false;
}
}
//----------------------------------------------------------------------------
bool cmDocumentation::CreateModulesSection()
{
cmDocumentationSection *sec =
new cmDocumentationSection("Standard CMake Modules", "MODULES");
this->AllSections["Modules"] = sec;
std::string cmakeModules = this->CMakeRoot;
cmakeModules += "/Modules";
cmsys::Directory dir;
dir.Load(cmakeModules.c_str());
if (dir.GetNumberOfFiles() > 0)
{
sec->Append(cmDocumentationModulesHeader[0]);
sec->Append(cmModulesDocumentationDescription);
this->CreateModuleDocsForDir(dir, *this->AllSections["Modules"]);
}
return true;
}
//----------------------------------------------------------------------------
bool cmDocumentation::CreateCustomModulesSection()
{
bool sectionHasHeader = false;
std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(this->CMakeModulePath, dirs);
for(std::vector<std::string>::const_iterator dirIt = dirs.begin();
dirIt != dirs.end();
++dirIt)
{
cmsys::Directory dir;
dir.Load(dirIt->c_str());
if (dir.GetNumberOfFiles() > 0)
{
if (!sectionHasHeader)
{
cmDocumentationSection *sec =