summaryrefslogtreecommitdiffstats
path: root/Source/cmDocumentation.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-08-06 18:49:52 (GMT)
committerBrad King <brad.king@kitware.com>2003-08-06 18:49:52 (GMT)
commitb78888fe3889c2477b0d0ce93d6ab14bcdd25000 (patch)
treedef2a368702638f0dd42e65b15c3aa3ceb520441 /Source/cmDocumentation.cxx
parentf86ffd72cae4d516e726586ee0a7f68f73f91bac (diff)
downloadCMake-b78888fe3889c2477b0d0ce93d6ab14bcdd25000.zip
CMake-b78888fe3889c2477b0d0ce93d6ab14bcdd25000.tar.gz
CMake-b78888fe3889c2477b0d0ce93d6ab14bcdd25000.tar.bz2
ENH: Added configuration of name of executable in man page header and version banner.
Diffstat (limited to 'Source/cmDocumentation.cxx')
-rw-r--r--Source/cmDocumentation.cxx27
1 files changed, 23 insertions, 4 deletions
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index edfc841..fad347e 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -73,7 +73,7 @@ const cmDocumentationEntry cmDocumentationMailingList[] =
const cmDocumentationEntry cmDocumentationAuthor[] =
{
{0,
- "This manual page was generated by \"cmake --help-man\".", 0},
+ "This manual page was generated by the \"--help-man\" option.", 0},
{0,0,0}
};
@@ -151,7 +151,7 @@ void cmDocumentation::PrintCopyright(std::ostream& os)
//----------------------------------------------------------------------------
void cmDocumentation::PrintVersion(std::ostream& os)
{
- os << "CMake version " CMake_VERSION_FULL "\n";
+ os << this->GetNameString() << " version " CMake_VERSION_FULL "\n";
}
//----------------------------------------------------------------------------
@@ -328,6 +328,12 @@ void cmDocumentation::Print(Form f, std::ostream& os)
}
//----------------------------------------------------------------------------
+void cmDocumentation::SetName(const char* name)
+{
+ this->NameString = name?name:"";
+}
+
+//----------------------------------------------------------------------------
void cmDocumentation::SetNameSection(const cmDocumentationEntry* section)
{
this->SetSection(0, section, 0, this->NameSection);
@@ -806,9 +812,9 @@ void cmDocumentation::PrintDocumentationHTML(std::ostream& os)
void cmDocumentation::PrintDocumentationMan(std::ostream& os)
{
this->CreateManDocumentation();
- os << ".TH CMake 1 \""
+ os << ".TH " << this->GetNameString() << " 1 \""
<< cmSystemTools::GetCurrentDateTime("%B %d, %Y").c_str()
- << "\" \"CMake " CMake_VERSION_FULL "\"\n";
+ << "\" \"" << this->GetNameString() << " " CMake_VERSION_FULL "\"\n";
this->Print(ManForm, os);
}
@@ -944,3 +950,16 @@ void cmDocumentation::SetSection(const cmDocumentationEntry* header,
cmDocumentationEntry empty = {0,0,0};
vec.push_back(empty);
}
+
+//----------------------------------------------------------------------------
+const char* cmDocumentation::GetNameString()
+{
+ if(this->NameString.length() > 0)
+ {
+ return this->NameString.c_str();
+ }
+ else
+ {
+ return "CMake";
+ }
+}