[cmake-commits] alex committed cmDocumentation.cxx 1.42 1.43
cmDocumentation.h 1.20 1.21 cmake.h 1.82 1.83 cmake.cxx 1.300 1.301
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Jun 22 08:44:53 EDT 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv14817
Modified Files:
cmDocumentation.cxx cmDocumentation.h cmake.h cmake.cxx
Log Message:
ENH: put compatibility commands in extra section and prepare for creating
separate man pages for properties, modules, commands and compatibility
commands
Alex
Index: cmake.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.h,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- cmake.h 15 Jun 2007 14:10:24 -0000 1.82
+++ cmake.h 22 Jun 2007 12:44:51 -0000 1.83
@@ -239,7 +239,16 @@
///! Get the variable watch object
cmVariableWatch* GetVariableWatch() { return this->VariableWatch; }
- void GetCommandDocumentation(std::vector<cmDocumentationEntry>&) const;
+ /** Get the documentation entries for the supported commands.
+ * If withCurrentCommands is true, the documentation for the
+ * recommended set of commands is included.
+ * If withCompatCommands is true, the documentation for discouraged
+ * (compatibility) commands is included.
+ * You probably don't want to set both to false.
+ */
+ void GetCommandDocumentation(std::vector<cmDocumentationEntry>& entries,
+ bool withCurrentCommands = true,
+ bool withCompatCommands = true) const;
void GetPropertiesDocumentation(std::vector<cmDocumentationEntry>&);
void GetGeneratorDocumentation(std::vector<cmDocumentationEntry>&);
Index: cmDocumentation.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cmDocumentation.h 2 Feb 2007 19:13:51 -0000 1.20
+++ cmDocumentation.h 22 Jun 2007 12:44:51 -0000 1.21
@@ -71,6 +71,9 @@
/** Set the listfile commands for standard document generation. */
void SetCommandsSection(const cmDocumentationEntry*);
+ /** Set the listfile compat. commands for standard document generation. */
+ void SetCompatCommandsSection(const cmDocumentationEntry*);
+
/** Set the properties for standard document generation. */
void SetPropertiesSection(const cmDocumentationEntry*);
@@ -206,6 +209,10 @@
void CreateUsageDocumentation();
void CreateFullDocumentation();
+ void CreateCurrentCommandDocumentation();
+ void CreateCompatCommandDocumentation();
+ void CreateModulesDocumentation();
+ void CreatePropertiesDocumentation();
void SetSection(const cmDocumentationEntry* header,
const cmDocumentationEntry* section,
Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.300
retrieving revision 1.301
diff -u -d -r1.300 -r1.301
--- cmake.cxx 15 Jun 2007 20:09:30 -0000 1.300
+++ cmake.cxx 22 Jun 2007 12:44:51 -0000 1.301
@@ -2135,12 +2135,19 @@
}
}
-void cmake::GetCommandDocumentation(
- std::vector<cmDocumentationEntry>& v) const
+void cmake::GetCommandDocumentation(std::vector<cmDocumentationEntry>& v,
+ bool withCurrentCommands,
+ bool withCompatCommands) const
{
for(RegisteredCommandsMap::const_iterator j = this->Commands.begin();
j != this->Commands.end(); ++j)
{
+ if ((( withCompatCommands == false) && ( (*j).second->IsDiscouraged()))
+ || ((withCurrentCommands == false) && (!(*j).second->IsDiscouraged())))
+ {
+ continue;
+ }
+
cmDocumentationEntry e =
{
(*j).second->GetName(),
Index: cmDocumentation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.cxx,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- cmDocumentation.cxx 8 Jun 2007 20:06:33 -0000 1.42
+++ cmDocumentation.cxx 22 Jun 2007 12:44:51 -0000 1.43
@@ -44,6 +44,48 @@
};
//----------------------------------------------------------------------------
+static const cmDocumentationEntry cmModulesDocumentationDescription[] =
+{
+ {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 "
+ "existance of headers to name just a few.", 0},
+ {0,0,0}
+};
+
+//----------------------------------------------------------------------------
+static const cmDocumentationEntry cmPropertiesDocumentationDescription[] =
+{
+ {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 buildsystem can be "
+ "customized.", 0},
+ {0,0,0}
+};
+
+//----------------------------------------------------------------------------
+static const cmDocumentationEntry cmCompatCommandsDocumentationDescription[] =
+{
+ {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 cmDocumentationEntry cmDocumentationCommandsHeader[] =
{
{0,
@@ -229,10 +271,10 @@
void cmDocumentation::AddSection(const cmSection& section)
{
if (!section.IsEmpty())
- {
- this->Names.push_back(section.GetName(this->CurrentForm));
- this->Sections.push_back(section.GetEntries());
- }
+ {
+ this->Names.push_back(section.GetName(this->CurrentForm));
+ this->Sections.push_back(section.GetEntries());
+ }
}
//----------------------------------------------------------------------------
@@ -637,6 +679,13 @@
}
//----------------------------------------------------------------------------
+void cmDocumentation::SetCompatCommandsSection(const cmDocumentationEntry*
+ section)
+{
+ this->CompatCommandsSection.Set(cmDocumentationCommandsHeader, section, 0);
+}
+
+//----------------------------------------------------------------------------
void cmDocumentation
::SetPropertiesSection(const cmDocumentationEntry* section)
{
@@ -1171,6 +1220,16 @@
return true;
}
}
+ for(cmDocumentationEntry* entry = this->CompatCommandsSection.GetEntries();
+ entry->brief; ++entry)
+ {
+ if(entry->name && this->SingleCommand == entry->name)
+ {
+ this->PrintDocumentationCommand(os, entry);
+ return true;
+ }
+ }
+
// Argument was not a command. Complain.
os << "Argument \"" << this->SingleCommand.c_str()
<< "\" to --help-command is not a CMake command. "
@@ -1380,6 +1439,7 @@
this->AddSection(this->OptionsSection);
this->AddSection(this->GeneratorsSection);
this->AddSection(this->CommandsSection);
+ this->AddSection(this->CompatCommandsSection);
this->AddSection(this->ModulesSection);
this->AddSection(this->PropertiesSection);
this->AddSection(this->CopyrightSection.GetName(this->CurrentForm),
@@ -1398,6 +1458,44 @@
}
}
+void cmDocumentation::CreateCurrentCommandDocumentation()
+{
+ this->ClearSections();
+ this->AddSection(this->DescriptionSection.GetName(CurrentForm), cmCompatCommandsDocumentationDescription);
+ this->AddSection(this->CompatCommandsSection);
+ this->AddSection(this->CopyrightSection.GetName(CurrentForm), cmDocumentationCopyright);
+ this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), cmDocumentationStandardSeeAlso);
+}
+
+void cmDocumentation::CreateCompatCommandDocumentation()
+{
+ this->ClearSections();
+ this->AddSection(this->DescriptionSection.GetName(CurrentForm), cmCompatCommandsDocumentationDescription);
+ this->AddSection(this->CompatCommandsSection);
+ this->AddSection(this->CopyrightSection.GetName(CurrentForm), cmDocumentationCopyright);
+ this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), cmDocumentationStandardSeeAlso);
+}
+
+//----------------------------------------------------------------------------
+void cmDocumentation::CreateModulesDocumentation()
+ {
+ this->ClearSections();
+ this->AddSection(this->DescriptionSection.GetName(CurrentForm), cmModulesDocumentationDescription);
+ this->AddSection(this->ModulesSection);
+ this->AddSection(this->CopyrightSection.GetName(CurrentForm), cmDocumentationCopyright);
+ this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), cmDocumentationStandardSeeAlso);
+}
+
+//----------------------------------------------------------------------------
+void cmDocumentation::CreatePropertiesDocumentation()
+{
+ this->ClearSections();
+ this->AddSection(this->DescriptionSection.GetName(CurrentForm), cmPropertiesDocumentationDescription);
+ this->AddSection(this->PropertiesSection);
+ this->AddSection(this->CopyrightSection.GetName(CurrentForm), cmDocumentationCopyright);
+ this->AddSection(this->SeeAlsoSection.GetName(CurrentForm), cmDocumentationStandardSeeAlso);
+}
+
//----------------------------------------------------------------------------
void cmDocumentation::cmSection::Set(const cmDocumentationEntry* header,
const cmDocumentationEntry* section,
More information about the Cmake-commits
mailing list