ENH: Improved name of cmake version variables. They are now CMake_VERSION (major.minor) and CMake_VERSION_FULL (major.minor.patch).

This commit is contained in:
Brad King 2003-07-07 23:20:30 -04:00
parent eb7b7dc104
commit ed273acfa7
4 changed files with 14 additions and 7 deletions

View File

@ -4,8 +4,8 @@ PROJECT(CMake)
SET(CMake_VERSION_MAJOR 1)
SET(CMake_VERSION_MINOR 7)
SET(CMake_VERSION_PATCH 0)
SET(CMake_VERSION_STRING
"${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.4)
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")

View File

@ -122,7 +122,7 @@ cmDocumentation::cmDocumentation()
//----------------------------------------------------------------------------
void cmDocumentation::PrintCopyright(std::ostream& os)
{
os << "CMake version " CMake_VERSION_STRING "\n";
os << "CMake version " CMake_VERSION_FULL "\n";
for(const cmDocumentationEntry* op = cmDocumentationCopyright;
op->brief; ++op)
{
@ -144,7 +144,7 @@ void cmDocumentation::PrintCopyright(std::ostream& os)
//----------------------------------------------------------------------------
void cmDocumentation::PrintVersion(std::ostream& os)
{
os << "CMake version " CMake_VERSION_STRING "\n";
os << "CMake version " CMake_VERSION_FULL "\n";
}
//----------------------------------------------------------------------------
@ -764,7 +764,7 @@ void cmDocumentation::PrintDocumentationMan(std::ostream& os)
this->CreateManDocumentation();
os << ".TH CMake 1 \""
<< cmSystemTools::GetCurrentDateTime("%B %d, %Y").c_str()
<< "\" \"CMake " CMake_VERSION_STRING "\"\n";
<< "\" \"CMake " CMake_VERSION_FULL "\"\n";
this->Print(ManForm, os);
}

View File

@ -66,7 +66,7 @@ int DumpHTML(const char* outname)
cmDocumentation doc;
std::vector<cmDocumentationEntry> commands;
cmi.GetCommandDocumentation(commands);
doc.AddSection("Documentation for Commands of CMake " CMake_VERSION_STRING,
doc.AddSection("Documentation for Commands of CMake " CMake_VERSION_FULL,
&commands[0]);
doc.Print(cmDocumentation::HTMLForm, fout);
@ -78,12 +78,15 @@ int DumpForCoverage()
cmake cmi;
cmDocumentation doc;
std::vector<cmDocumentationEntry> commands;
std::vector<cmDocumentationEntry> generators;
cmi.GetCommandDocumentation(commands);
cmi.GetGeneratorDocumentation(generators);
doc.SetNameSection(cmDocumentationName);
doc.SetUsageSection(cmDocumentationUsage);
doc.SetDescriptionSection(cmDocumentationDescription);
doc.SetOptionsSection(cmDocumentationOptions);
doc.SetCommandsSection(&commands[0]);
doc.SetGeneratorsSection(&generators[0]);
doc.PrintDocumentation(cmDocumentation::Usage, std::cout);
doc.PrintDocumentation(cmDocumentation::Full, std::cout);
doc.PrintDocumentation(cmDocumentation::HTML, std::cout);

View File

@ -28,7 +28,11 @@
// CMAKE_NO_STD_NAMESPACE, and other macros.
#include "cmConfigure.h"
#define CMake_VERSION_STRING \
#define CMake_VERSION \
CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
CMAKE_TO_STRING(CMake_VERSION_MINOR)
#define CMake_VERSION_FULL \
CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
CMAKE_TO_STRING(CMake_VERSION_MINOR) "." \
CMAKE_TO_STRING(CMake_VERSION_PATCH)