From ed273acfa7884c0b9dddf480deec9a263f536c85 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 7 Jul 2003 23:20:30 -0400 Subject: [PATCH] ENH: Improved name of cmake version variables. They are now CMake_VERSION (major.minor) and CMake_VERSION_FULL (major.minor.patch). --- CMakeLists.txt | 4 ++-- Source/cmDocumentation.cxx | 6 +++--- Source/cmDumpDocumentation.cxx | 5 ++++- Source/cmStandardIncludes.h | 6 +++++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 239115071..7655d6654 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 390ab5b36..21cde8806 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -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); } diff --git a/Source/cmDumpDocumentation.cxx b/Source/cmDumpDocumentation.cxx index edee6d677..0b474c467 100644 --- a/Source/cmDumpDocumentation.cxx +++ b/Source/cmDumpDocumentation.cxx @@ -66,7 +66,7 @@ int DumpHTML(const char* outname) cmDocumentation doc; std::vector 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 commands; + std::vector 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); diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 0b3aef590..98211b6f1 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -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)