summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-12-08 14:38:36 (GMT)
committerBrad King <brad.king@kitware.com>2009-12-08 14:38:36 (GMT)
commit1d91bc64aa824c58ddcffeae4efb14d89a89c493 (patch)
tree773e2247ff84d25396a8b6c13a725e8d6ec890e1
parentf1d4f951d625c0168c445eb6512463dcc2f4a0cf (diff)
downloadCMake-1d91bc64aa824c58ddcffeae4efb14d89a89c493.zip
CMake-1d91bc64aa824c58ddcffeae4efb14d89a89c493.tar.gz
CMake-1d91bc64aa824c58ddcffeae4efb14d89a89c493.tar.bz2
Remove unused DumpDocumentation code
The DumpDocumentation executable and some supporting code and tests were completely unused by CMake. Generation of documentation is done by the individual executables with --help* options. In this commit we simply remove the unused code, executable, and test.
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/cmDumpDocumentation.cxx150
-rw-r--r--Source/cmake.cxx28
-rw-r--r--Source/cmake.h6
-rw-r--r--Tests/CommandLineTest/CMakeLists.txt10
5 files changed, 0 insertions, 196 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index ecbecaf..7568de0 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -459,8 +459,6 @@ ENDIF(APPLE)
# Build CMake executable
ADD_EXECUTABLE(cmake cmakemain.cxx)
TARGET_LINK_LIBRARIES(cmake CMakeLib)
-ADD_EXECUTABLE(DumpDocumentation cmDumpDocumentation)
-TARGET_LINK_LIBRARIES(DumpDocumentation CMakeLib)
# Build special executable for running programs on Windows 98
IF(WIN32)
diff --git a/Source/cmDumpDocumentation.cxx b/Source/cmDumpDocumentation.cxx
deleted file mode 100644
index 877ed13..0000000
--- a/Source/cmDumpDocumentation.cxx
+++ /dev/null
@@ -1,150 +0,0 @@
-/*============================================================================
- 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.
-============================================================================*/
-// Program extracts documentation describing commands from
-// the CMake system.
-//
-#include "cmake.h"
-
-#include "cmDocumentation.h"
-#include "cmVersion.h"
-
-//----------------------------------------------------------------------------
-static const char *cmDocumentationName[][3] =
-{
- {0,
- " DumpDocumentation - Dump documentation for CMake.", 0},
- {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char *cmDocumentationUsage[][3] =
-{
- {0,
- " DumpDocumentation [filename]", 0},
- {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char *cmDocumentationDescription[][3] =
-{
- {0,
- "The \"DumpDocumentation\" executable is only available in the build "
- "tree. It is used for testing, coverage, and documentation.", 0},
- CMAKE_STANDARD_INTRODUCTION,
- {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char *cmDocumentationOptions[][3] =
-{
- {"--all-for-coverage",
- "Dump all documentation to stdout. For testing.", 0},
- {0,0,0}
-};
-
-
-int DumpHTML(const char* outname)
-{
- std::ofstream fout(outname);
- if(!fout)
- {
- std::cerr << "failed to open output file: " << outname << "\n";
- cmSystemTools::ReportLastSystemError("");
- return -1;
- }
-
- cmake cmi;
- cmDocumentation doc;
- std::vector<cmDocumentationEntry> commands;
- cmi.GetCommandDocumentation(commands);
- cmOStringStream str;
- str << "Documentation for Commands of CMake "
- << cmVersion::GetCMakeVersion();
- doc.SetSection(str.str().c_str(), commands);
- doc.Print(cmDocumentation::HTMLForm, fout);
-
- return 0;
-}
-
-int DumpForCoverageToStream(std::ostream& out)
-{
- cmake cmi;
- cmDocumentation doc;
- std::vector<cmDocumentationEntry> commands;
- std::vector<cmDocumentationEntry> generators;
- cmi.GetCommandDocumentation(commands);
- cmi.GetGeneratorDocumentation(generators);
- doc.SetSection("Name",cmDocumentationName);
- doc.SetSection("Usage",cmDocumentationUsage);
- doc.SetSection("Description",cmDocumentationDescription);
- doc.SetSection("options",cmDocumentationOptions);
- doc.SetSection("Commands",commands);
- doc.SetSection("Generators",generators);
- doc.PrintDocumentation(cmDocumentation::Usage, out);
- doc.PrintDocumentation(cmDocumentation::Full, out);
- return 0;
-}
-
-int DumpForCoverage(const char* outname)
-{
- if(outname)
- {
- std::ofstream fout(outname);
- if(!fout)
- {
- std::cerr << "failed to open output file: " << outname << "\n";
- cmSystemTools::ReportLastSystemError("");
- return -1;
- }
- return DumpForCoverageToStream(fout);
- }
- else
- {
- return DumpForCoverageToStream(std::cout);
- }
-}
-
-int main(int ac, char** av)
-{
- cmSystemTools::EnableMSVCDebugHook();
- cmSystemTools::FindExecutableDirectory(av[0]);
- const char* outname = "cmake.html";
- bool coverage = false;
- if(ac > 1)
- {
- if(strcmp(av[1], "--all-for-coverage") == 0)
- {
- coverage = true;
- if(ac > 2)
- {
- outname = av[2];
- }
- else
- {
- outname = 0;
- }
- }
- else
- {
- outname = av[1];
- }
- }
-
- if(coverage)
- {
- return DumpForCoverage(outname);
- }
- else
- {
- return DumpHTML(outname);
- }
-}
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 031b0c2..a01e0e0 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2322,34 +2322,6 @@ const char* cmake::GetCacheDefinition(const char* name) const
return this->CacheManager->GetCacheValue(name);
}
-int cmake::DumpDocumentationToFile(std::ostream& f)
-{
-#ifdef CMAKE_BUILD_WITH_CMAKE
- // Loop over all registered commands and print out documentation
- const char *name;
- const char *terse;
- const char *full;
- char tmp[1024];
- sprintf(tmp,"Version %s", cmVersion::GetCMakeVersion());
- f << "<html>\n";
- f << "<h1>Documentation for commands of CMake " << tmp << "</h1>\n";
- f << "<ul>\n";
- for(RegisteredCommandsMap::iterator j = this->Commands.begin();
- j != this->Commands.end(); ++j)
- {
- name = (*j).second->GetName();
- terse = (*j).second->GetTerseDocumentation();
- full = (*j).second->GetFullDocumentation();
- f << "<li><b>" << name << "</b> - " << terse << std::endl
- << "<br><i>Usage:</i> " << full << "</li>" << std::endl << std::endl;
- }
- f << "</ul></html>\n";
-#else
- (void)f;
-#endif
- return 1;
-}
-
void cmake::AddDefaultCommands()
{
std::list<cmCommand*> commands;
diff --git a/Source/cmake.h b/Source/cmake.h
index 37e38b7..8312795 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -123,12 +123,6 @@ class cmake
//@}
/**
- * Dump documentation to a file. If 0 is returned, the
- * operation failed.
- */
- int DumpDocumentationToFile(std::ostream&);
-
- /**
* Handle a command line invocation of cmake.
*/
int Run(const std::vector<std::string>&args)
diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt
index e01a4c7..0493a0c 100644
--- a/Tests/CommandLineTest/CMakeLists.txt
+++ b/Tests/CommandLineTest/CMakeLists.txt
@@ -2,7 +2,6 @@ cmake_minimum_required (VERSION 2.6)
PROJECT(CommandLineTest)
GET_FILENAME_COMPONENT(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH)
-FIND_PROGRAM(DUMP_DOC_EXE NAMES DumpDocumentation PATHS ${CMAKE_BIN_DIR})
MACRO(EXEC_CMAKE_COMMAND CMAKE_ARGS)
EXEC_PROGRAM("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET)
IF(${RET})
@@ -25,15 +24,6 @@ EXEC_CMAKE_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/cmake.html\"")
EXEC_CMAKE_COMMAND("--copyright \"${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt\"")
EXEC_CMAKE_COMMAND("--version \"${CMAKE_CURRENT_BINARY_DIR}/version.txt\"")
-IF(DUMP_DOC_EXE)
- EXEC_PROGRAM(${DUMP_DOC_EXE} ARGS "--all-for-coverage \"${CMAKE_CURRENT_BINARY_DIR}/all_for_coverage.txt\"" RETURN_VALUE RET)
- IF(${RET})
- MESSAGE(SEND_ERROR "DumpDoc command failed ")
- ENDIF(${RET})
-ELSE(DUMP_DOC_EXE)
- MESSAGE(SEND_ERROR "Cannot find DumpDocumentation executable.")
-ENDIF(DUMP_DOC_EXE)
-
ADD_EXECUTABLE(CommandLineTest CommandLineTest.cxx)
GET_FILENAME_COMPONENT(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH)