Merge topic 'doc-reStructuredText'

7038a93 Modules/readme.txt: Update steps to add module documentation
a77e308 CPack: Replace #<type> markup with reStructuredText equivalent
e7ca48f Help: Factor out cmake-generator-expressions manual page
97e8650 Help: Factor out COMPILE_DEFINITIONS disclaimer duplication
8982161 Help: Factor out find_* command duplication
30b2186 Help: Factor out *_OUTPUT_(NAME|DIRECTORY).rst duplication
bfe07aa Build Help documentation during CMake build using Sphinx
53ded59 Drop unused builtin documentation APIs
0c39a75 Drop the 'Full' field from cmDocumentationEntry
e33d8d2 Drop builtin command documentation
399e9c4 Drop builtin property documentation
6035c04 get_property: Drop test for builtin property documentation
80a3273 Drop all documentation formatters except Usage
b336a1eb Teach COMPATIBLE_INTERFACE_* checks to use Help .rst documents
ec6df36 Teach --help-* options to load documentation from .rst files
25f2877 Add class cmRST to do basic reStructuredText processing
...
This commit is contained in:
Brad King
2013-10-16 09:28:12 -04:00
committed by CMake Topic Stage
1352 changed files with 23723 additions and 35805 deletions

View File

@@ -0,0 +1,36 @@
# Keep formatting here consistent with bootstrap script expectations.
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION}") # OTHER
if(BEOS)
set(CMAKE_MAN_DIR_DEFAULT "documentation/man") # HAIKU
set(CMAKE_DOC_DIR_DEFAULT "documentation/doc/cmake-${CMake_VERSION}") # HAIKU
elseif(CYGWIN)
set(CMAKE_DOC_DIR_DEFAULT "share/doc/cmake-${CMake_VERSION}") # CYGWIN
set(CMAKE_MAN_DIR_DEFAULT "share/man") # CYGWIN
else()
set(CMAKE_DOC_DIR_DEFAULT "doc/cmake-${CMake_VERSION}") # OTHER
set(CMAKE_MAN_DIR_DEFAULT "man") # OTHER
endif()
set(CMAKE_DATA_DIR_DESC "data")
set(CMAKE_DOC_DIR_DESC "docs")
set(CMAKE_MAN_DIR_DESC "man pages")
foreach(v
CMAKE_DATA_DIR
CMAKE_DOC_DIR
CMAKE_MAN_DIR
)
# Populate the cache with empty values so we know when the user sets them.
set(${v} "" CACHE STRING "")
set_property(CACHE ${v} PROPERTY HELPSTRING
"Location under install prefix for ${${v}_DESC} (default \"${${v}_DEFAULT}\")"
)
set_property(CACHE ${v} PROPERTY ADVANCED 1)
# Use the default when the user did not set this variable.
if(NOT ${v})
set(${v} "${${v}_DEFAULT}")
endif()
# Remove leading slash to treat as relative to install prefix.
string(REGEX REPLACE "^/" "" ${v} "${${v}}")
endforeach()

View File

@@ -159,16 +159,7 @@ set(SRCS
cmDependsJavaParserHelper.h
cmDocumentation.cxx
cmDocumentationFormatter.cxx
cmDocumentationFormatterHTML.cxx
cmDocumentationFormatterDocbook.cxx
cmDocumentationFormatterMan.cxx
cmDocumentationFormatterText.cxx
cmDocumentationFormatterUsage.cxx
cmDocumentationSection.cxx
cmDocumentCompileDefinitions.h
cmDocumentGeneratorExpressions.h
cmDocumentLocationUndefined.h
cmDocumentVariables.cxx
cmDynamicLoader.cxx
cmDynamicLoader.h
${ELF_SRCS}
@@ -261,6 +252,8 @@ set(SRCS
cmPropertyMap.h
cmQtAutomoc.cxx
cmQtAutomoc.h
cmRST.cxx
cmRST.h
cmScriptGenerator.h
cmScriptGenerator.cxx
cmSourceFile.cxx
@@ -497,8 +490,6 @@ set(CPACK_SRCS
CPack/cmCPackTarBZip2Generator.cxx
CPack/cmCPackTarCompressGenerator.cxx
CPack/cmCPackZIPGenerator.cxx
CPack/cmCPackDocumentVariables.cxx
CPack/cmCPackDocumentMacros.cxx
)
if(CYGWIN)

View File

@@ -0,0 +1,23 @@
# Load version number components.
include(${CMake_SOURCE_DIR}/Source/CMakeVersion.cmake)
# Releases define a small tweak level.
if("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000)
set(CMake_VERSION_IS_RELEASE 1)
set(CMake_VERSION_SOURCE "")
else()
set(CMake_VERSION_IS_RELEASE 0)
include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
endif()
# Compute the full version string.
set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
if(${CMake_VERSION_TWEAK} GREATER 0)
set(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
endif()
if(CMake_VERSION_RC)
set(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
endif()
if(CMake_VERSION_SOURCE)
set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
endif()

View File

@@ -1,16 +0,0 @@
#include "cmCPackDocumentMacros.h"
void cmCPackDocumentMacros::GetMacrosDocumentation(
std::vector<cmDocumentationEntry>& )
{
// Commented-out example of use
//
// cmDocumentationEntry e("cpack_<macro>",
// "Brief Description"
// "which may be on several lines.",
// "Long description in pre-formatted format"
// " blah\n"
// " blah\n"
//);
//v.push_back(e);
}

View File

@@ -1,21 +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.
============================================================================*/
#ifndef cmCPackDocumentMacros_h
#define cmCPackDocumentMacros_h
#include "cmStandardIncludes.h"
class cmCPackDocumentMacros
{
public:
static void GetMacrosDocumentation(std::vector<cmDocumentationEntry>& v);
};
#endif

View File

@@ -1,122 +0,0 @@
#include "cmCPackDocumentVariables.h"
#include "cmake.h"
void cmCPackDocumentVariables::DefineVariables(cmake* cm)
{
// Subsection: variables defined/used by cpack,
// which are common to all CPack generators
cm->DefineProperty
("CPACK_PACKAGING_INSTALL_PREFIX", cmProperty::VARIABLE,
"The prefix used in the built package.",
"Each CPack generator has a default value (like /usr)."
" This default value may"
" be overwritten from the CMakeLists.txt or the cpack command line"
" by setting an alternative value.\n"
"e.g. "
" set(CPACK_PACKAGING_INSTALL_PREFIX \"/opt\")\n"
"This is not the same purpose as CMAKE_INSTALL_PREFIX which"
" is used when installing from the build tree without building"
" a package."
"", false,
"Variables common to all CPack generators");
cm->DefineProperty
("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", cmProperty::VARIABLE,
"Boolean toggle to include/exclude top level directory.",
"When preparing a package CPack installs the item under"
" the so-called top level directory. The purpose of"
" is to include (set to 1 or ON or TRUE) the top level directory"
" in the package or not (set to 0 or OFF or FALSE).\n"
"Each CPack generator has a built-in default value for this"
" variable. E.g. Archive generators (ZIP, TGZ, ...) includes"
" the top level whereas RPM or DEB don't. The user may override"
" the default value by setting this variable.\n"
"There is a similar variable "
"CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY "
"which may be used to override the behavior for the component"
" packaging case which may have different default value for"
" historical (now backward compatibility) reason.", false,
"Variables common to all CPack generators");
cm->DefineProperty
("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY", cmProperty::VARIABLE,
"Boolean toggle to include/exclude top level directory "
"(component case).",
"Similar usage as CPACK_INCLUDE_TOPLEVEL_DIRECTORY"
" but for the component case. "
"See CPACK_INCLUDE_TOPLEVEL_DIRECTORY documentation for"
" the detail.", false,
"Variables common to all CPack generators");
cm->DefineProperty
("CPACK_SET_DESTDIR", cmProperty::VARIABLE,
"Boolean toggle to make CPack use DESTDIR mechanism when"
" packaging.", "DESTDIR means DESTination DIRectory."
" It is commonly used by makefile "
"users in order to install software at non-default location. It "
"is a basic relocation mechanism that should not be used on"
" Windows (see CMAKE_INSTALL_PREFIX documentation). "
"It is usually invoked like this:\n"
" make DESTDIR=/home/john install\n"
"which will install the concerned software using the"
" installation prefix, e.g. \"/usr/local\" prepended with "
"the DESTDIR value which finally gives \"/home/john/usr/local\"."
" When preparing a package, CPack first installs the items to be "
"packaged in a local (to the build tree) directory by using the "
"same DESTDIR mechanism. Nevertheless, if "
"CPACK_SET_DESTDIR is set then CPack will set DESTDIR before"
" doing the local install. The most noticeable difference is"
" that without CPACK_SET_DESTDIR, CPack uses "
"CPACK_PACKAGING_INSTALL_PREFIX as a prefix whereas with "
"CPACK_SET_DESTDIR set, CPack will use CMAKE_INSTALL_PREFIX as"
" a prefix.\n"
"Manually setting CPACK_SET_DESTDIR may help (or simply be"
" necessary) if some install rules uses absolute "
"DESTINATION (see CMake INSTALL command)."
" However, starting with"
" CPack/CMake 2.8.3 RPM and DEB installers tries to handle DESTDIR"
" automatically so that it is seldom necessary for the user to set"
" it.", false,
"Variables common to all CPack generators");
cm->DefineProperty
("CPACK_INSTALL_SCRIPT", cmProperty::VARIABLE,
"Extra CMake script provided by the user.",
"If set this CMake script will be executed by CPack "
"during its local [CPack-private] installation "
"which is done right before packaging the files."
" The script is not called by e.g.: make install.", false,
"Variables common to all CPack generators");
cm->DefineProperty
("CPACK_ABSOLUTE_DESTINATION_FILES", cmProperty::VARIABLE,
"List of files which have been installed using "
" an ABSOLUTE DESTINATION path.",
"This variable is a Read-Only variable which is set internally"
" by CPack during installation and before packaging using"
" CMAKE_ABSOLUTE_DESTINATION_FILES defined in cmake_install.cmake "
"scripts. The value can be used within CPack project configuration"
" file and/or CPack<GEN>.cmake file of <GEN> generator.", false,
"Variables common to all CPack generators");
cm->DefineProperty
("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE,
"Ask CPack to warn each time a file with absolute INSTALL"
" DESTINATION is encountered.",
"This variable triggers the definition of "
"CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION when CPack runs"
" cmake_install.cmake scripts.", false,
"Variables common to all CPack generators");
cm->DefineProperty
("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE,
"Ask CPack to error out as soon as a file with absolute INSTALL"
" DESTINATION is encountered.",
"The fatal error is emitted before the installation of "
"the offending file takes place. Some CPack generators, like NSIS,"
"enforce this internally. "
"This variable triggers the definition of"
"CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION when CPack runs"
"Variables common to all CPack generators");
}

View File

@@ -1,21 +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.
============================================================================*/
#ifndef cmCPackDocumentVariables_h
#define cmCPackDocumentVariables_h
class cmake;
class cmCPackDocumentVariables
{
public:
static void DefineVariables(cmake* cm);
};
#endif

View File

@@ -14,8 +14,6 @@
// Need these for documentation support.
#include "cmake.h"
#include "cmDocumentation.h"
#include "cmCPackDocumentVariables.h"
#include "cmCPackDocumentMacros.h"
#include "cmCPackGeneratorFactory.h"
#include "cmCPackGenerator.h"
#include "cmake.h"
@@ -29,112 +27,42 @@
#include <cmsys/SystemTools.hxx>
//----------------------------------------------------------------------------
static const char * cmDocumentationName[][3] =
static const char * cmDocumentationName[][2] =
{
{0,
" cpack - Packaging driver provided by CMake.", 0},
{0,0,0}
" cpack - Packaging driver provided by CMake."},
{0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationUsage[][3] =
static const char * cmDocumentationUsage[][2] =
{
{0,
" cpack -G <generator> [options]",
0},
{0,0,0}
" cpack -G <generator> [options]"},
{0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationDescription[][3] =
static const char * cmDocumentationOptions[][2] =
{
{0,
"The \"cpack\" executable is the CMake packaging program. "
"CMake-generated build trees created for projects that use "
"the INSTALL_* commands have packaging support. "
"This program will generate the package.", 0},
CMAKE_STANDARD_INTRODUCTION,
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationOptions[][3] =
{
{"-G <generator>", "Use the specified generator to generate package.",
"CPack may support multiple native packaging systems on certain "
"platforms. A generator is responsible for generating input files for "
"particular system and invoking that systems. Possible generator names "
"are specified in the Generators section." },
{"-C <Configuration>", "Specify the project configuration",
"This option specifies the configuration that the project was build "
"with, for example 'Debug', 'Release'." },
{"-D <var>=<value>", "Set a CPack variable.", \
"Set a variable that can be used by the generator."}, \
{"--config <config file>", "Specify the config file.",
"Specify the config file to use to create the package. By default "
"CPackConfig.cmake in the current directory will be used." },
{"--verbose,-V","enable verbose output","Run cpack with verbose output."},
{"--debug","enable debug output (for CPack developers)",
"Run cpack with debug output (for CPack developers)."},
{"-P <package name>","override/define CPACK_PACKAGE_NAME",
"If the package name is not specified on cpack commmand line then"
"CPack.cmake defines it as CMAKE_PROJECT_NAME"},
{"-R <package version>","override/define CPACK_PACKAGE_VERSION",
"If version is not specified on cpack command line then"
"CPack.cmake defines it from CPACK_PACKAGE_VERSION_[MAJOR|MINOR|PATCH]"
"look into CPack.cmake for detail"},
{"-B <package directory>","override/define CPACK_PACKAGE_DIRECTORY",
"The directory where CPack will be doing its packaging work."
"The resulting package will be found there. Inside this directory"
"CPack creates '_CPack_Packages' sub-directory which is the"
"CPack temporary directory."},
{"--vendor <vendor name>","override/define CPACK_PACKAGE_VENDOR",
"If vendor is not specified on cpack command line "
"(or inside CMakeLists.txt) then"
"CPack.cmake defines it with a default value"},
{"--help-command cmd [file]", "Print help for a single command and exit.",
"Full documentation specific to the given command is displayed. "
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{"--help-command-list [file]", "List available commands and exit.",
"The list contains all commands for which help may be obtained by using "
"the --help-command argument followed by a command name. "
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{"--help-commands [file]", "Print help for all commands and exit.",
"Full documentation specific for all current command is displayed."
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{"-G <generator>", "Use the specified generator to generate package."},
{"-C <Configuration>", "Specify the project configuration"},
{"-D <var>=<value>", "Set a CPack variable."},
{"--config <config file>", "Specify the config file."},
{"--verbose,-V","enable verbose output"},
{"--debug","enable debug output (for CPack developers)"},
{"-P <package name>","override/define CPACK_PACKAGE_NAME"},
{"-R <package version>","override/define CPACK_PACKAGE_VERSION"},
{"-B <package directory>","override/define CPACK_PACKAGE_DIRECTORY"},
{"--vendor <vendor name>","override/define CPACK_PACKAGE_VENDOR"},
{"--help-command cmd [file]", "Print help for a single command and exit."},
{"--help-command-list [file]", "List available commands and exit."},
{"--help-commands [file]", "Print help for all commands and exit."},
{"--help-variable var [file]",
"Print help for a single variable and exit.",
"Full documentation specific to the given variable is displayed."
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{"--help-variable-list [file]", "List documented variables and exit.",
"The list contains all variables for which help may be obtained by using "
"the --help-variable argument followed by a variable name. If a file is "
"specified, the help is written into it."
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{"--help-variables [file]", "Print help for all variables and exit.",
"Full documentation for all variables is displayed."
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationSeeAlso[][3] =
{
{0, "cmake", 0},
{0, "ccmake", 0},
{0, 0, 0}
"Print help for a single variable and exit."},
{"--help-variable-list [file]", "List documented variables and exit."},
{"--help-variables [file]", "Print help for all variables and exit."},
{0,0}
};
//----------------------------------------------------------------------------
@@ -533,43 +461,8 @@ int main (int argc, char *argv[])
doc.SetName("cpack");
doc.SetSection("Name",cmDocumentationName);
doc.SetSection("Usage",cmDocumentationUsage);
doc.SetSection("Description",cmDocumentationDescription);
doc.PrependSection("Options",cmDocumentationOptions);
// statically (in C++ code) defined variables
cmCPackDocumentVariables::DefineVariables(&cminst);
std::vector<cmDocumentationEntry> commands;
std::string docedFile;
std::string docPath;
cmDocumentation::documentedModulesList_t docedModList;
docedFile = globalMF->GetModulesFile("CPack.cmake");
if (docedFile.length()!=0)
{
docPath = cmSystemTools::GetFilenamePath(docedFile.c_str());
doc.getDocumentedModulesListInDir(docPath,"CPack*.cmake",docedModList);
}
// parse the files for documentation.
cmDocumentation::documentedModulesList_t::iterator docedIt;
for (docedIt = docedModList.begin();
docedIt!= docedModList.end(); ++docedIt)
{
doc.GetStructuredDocFromFile(
(docedIt->first).c_str(),
commands,&cminst);
}
std::map<std::string,cmDocumentationSection *> propDocs;
cminst.GetPropertiesDocumentation(propDocs);
doc.SetSections(propDocs);
cminst.GetCommandDocumentation(commands,true,false);
// statically (in C++ code) defined macros/commands
cmCPackDocumentMacros::GetMacrosDocumentation(commands);
doc.SetSection("Commands",commands);
std::vector<cmDocumentationEntry> v;
cmCPackGeneratorFactory::DescriptionsMap::const_iterator generatorIt;
for( generatorIt = generators.GetGeneratorsList().begin();
@@ -579,12 +472,10 @@ int main (int argc, char *argv[])
cmDocumentationEntry e;
e.Name = generatorIt->first.c_str();
e.Brief = generatorIt->second.c_str();
e.Full = "";
v.push_back(e);
}
doc.SetSection("Generators",v);
doc.SetSeeAlsoList(cmDocumentationSeeAlso);
#undef cout
return doc.PrintRequestedDocumentation(std::cout)? 0:1;
#define cout no_cout_use_cmCPack_Log

View File

@@ -45,34 +45,8 @@ public:
*/
virtual const char* GetName() const { return "ctest_build";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Build the project.";
}
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_build([BUILD build_dir] [TARGET target] [RETURN_VALUE res]\n"
" [APPEND][NUMBER_ERRORS val] [NUMBER_WARNINGS val])\n"
"Builds the given build directory and stores results in Build.xml. "
"If no BUILD is given, the CTEST_BINARY_DIRECTORY variable is used.\n"
"The TARGET variable can be used to specify a build target. If none "
"is specified, the \"all\" target will be built.\n"
"The RETURN_VALUE option specifies a variable in which to store the "
"return value of the native build tool. "
"The NUMBER_ERRORS and NUMBER_WARNINGS options specify variables in "
"which to store the number of build errors and warnings detected."
"\n"
CTEST_COMMAND_APPEND_OPTION_DOCS;
}
cmTypeMacro(cmCTestBuildCommand, cmCTestHandlerCommand);

View File

@@ -40,34 +40,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_configure";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Configure the project build tree.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_configure([BUILD build_dir] [SOURCE source_dir] [APPEND]\n"
" [OPTIONS options] [RETURN_VALUE res])\n"
"Configures the given build directory and stores results in "
"Configure.xml. "
"If no BUILD is given, the CTEST_BINARY_DIRECTORY variable is used. "
"If no SOURCE is given, the CTEST_SOURCE_DIRECTORY variable is used. "
"The OPTIONS argument specifies command line arguments to pass to "
"the configuration tool. "
"The RETURN_VALUE option specifies a variable in which to store the "
"return value of the native build tool."
"\n"
CTEST_COMMAND_APPEND_OPTION_DOCS;
}
cmTypeMacro(cmCTestConfigureCommand, cmCTestHandlerCommand);
protected:

View File

@@ -41,32 +41,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_coverage";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Collect coverage tool results.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_coverage([BUILD build_dir] [RETURN_VALUE res] [APPEND]\n"
" [LABELS label1 [label2 [...]]])\n"
"Perform the coverage of the given build directory and stores results "
"in Coverage.xml. The second argument is a variable that will hold "
"value."
"\n"
"The LABELS option filters the coverage report to include only "
"source files labeled with at least one of the labels specified."
"\n"
CTEST_COMMAND_APPEND_OPTION_DOCS;
}
cmTypeMacro(cmCTestCoverageCommand, cmCTestHandlerCommand);
protected:

View File

@@ -50,26 +50,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_empty_binary_directory";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "empties the binary directory";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_empty_binary_directory( directory )\n"
"Removes a binary directory. This command will perform some checks "
"prior to deleting the directory in an attempt to avoid malicious "
"or accidental directory deletion.";
}
cmTypeMacro(cmCTestEmptyBinaryDirectoryCommand, cmCTestCommand);
};

View File

@@ -43,40 +43,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_memcheck";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Run tests with a dynamic analysis tool.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_memcheck([BUILD build_dir] [RETURN_VALUE res] [APPEND]\n"
" [START start number] [END end number]\n"
" [STRIDE stride number] [EXCLUDE exclude regex ]\n"
" [INCLUDE include regex] \n"
" [EXCLUDE_LABEL exclude regex] \n"
" [INCLUDE_LABEL label regex] \n"
" [PARALLEL_LEVEL level] )\n"
"Tests the given build directory and stores results in MemCheck.xml. "
"The second argument is a variable that will hold value. Optionally, "
"you can specify the starting test number START, the ending test number "
"END, the number of tests to skip between each test STRIDE, a regular "
"expression for tests to run INCLUDE, or a regular expression for tests "
"not to run EXCLUDE. EXCLUDE_LABEL and INCLUDE_LABEL are regular "
"expressions for tests to be included or excluded by the test "
"property LABEL. PARALLEL_LEVEL should be set to a positive number "
"representing the number of tests to be run in parallel."
"\n"
CTEST_COMMAND_APPEND_OPTION_DOCS;
}
cmTypeMacro(cmCTestMemCheckCommand, cmCTestTestCommand);
protected:

View File

@@ -48,25 +48,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_read_custom_files";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "read CTestCustom files.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_read_custom_files( directory ... )\n"
"Read all the CTestCustom.ctest or CTestCustom.cmake files from "
"the given directory.";
}
cmTypeMacro(cmCTestReadCustomFilesCommand, cmCTestCommand);
};

View File

@@ -49,30 +49,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_run_script";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "runs a ctest -S script";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_run_script([NEW_PROCESS] script_file_name script_file_name1 \n"
" script_file_name2 ... [RETURN_VALUE var])\n"
"Runs a script or scripts much like if it was run from ctest -S. "
"If no argument is provided then the current script is run using "
"the current settings of the variables. If NEW_PROCESS is specified "
"then each script will be run in a separate process."
"If RETURN_VALUE is specified the return value of the last script "
"run will be put into var.";
}
cmTypeMacro(cmCTestRunScriptCommand, cmCTestCommand);
};

View File

@@ -361,12 +361,6 @@ void cmCTestScriptHandler::CreateCMake()
this->AddCTestCommand(new cmCTestUploadCommand);
}
void cmCTestScriptHandler::GetCommandDocumentation(
std::vector<cmDocumentationEntry>& v) const
{
this->CMake->GetCommandDocumentation(v);
}
//----------------------------------------------------------------------
// this sets up some variables for the script to use, creates the required
// cmake instance and generators, and then reads in the script

View File

@@ -110,7 +110,6 @@ public:
void Initialize();
void CreateCMake();
void GetCommandDocumentation(std::vector<cmDocumentationEntry>& v) const;
cmake* GetCMake() { return this->CMake;}
private:
// reads in a script

View File

@@ -49,26 +49,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_sleep";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "sleeps for some amount of time";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_sleep(<seconds>)\n"
"Sleep for given number of seconds.\n"
" ctest_sleep(<time1> <duration> <time2>)\n"
"Sleep for t=(time1 + duration - time2) seconds if t > 0.";
}
cmTypeMacro(cmCTestSleepCommand, cmCTestCommand);
};

View File

@@ -57,30 +57,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_start";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Starts the testing for a given model";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_start(Model [TRACK <track>] [APPEND] [source [binary]])\n"
"Starts the testing for a given model. The command should be called "
"after the binary directory is initialized. If the 'source' and "
"'binary' directory are not specified, it reads the "
"CTEST_SOURCE_DIRECTORY and CTEST_BINARY_DIRECTORY. If the track is "
"specified, the submissions will go to the specified track. "
"If APPEND is used, the existing TAG is used rather than "
"creating a new one based on the current time stamp.";
}
cmTypeMacro(cmCTestStartCommand, cmCTestCommand);
private:

View File

@@ -50,44 +50,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_submit";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Submit results to a dashboard server.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_submit([PARTS ...] [FILES ...] [RETRY_COUNT count] "
" [RETRY_DELAY delay][RETURN_VALUE res])\n"
"By default all available parts are submitted if no PARTS or FILES "
"are specified. "
"The PARTS option lists a subset of parts to be submitted. "
"Valid part names are:\n"
" Start = nothing\n"
" Update = ctest_update results, in Update.xml\n"
" Configure = ctest_configure results, in Configure.xml\n"
" Build = ctest_build results, in Build.xml\n"
" Test = ctest_test results, in Test.xml\n"
" Coverage = ctest_coverage results, in Coverage.xml\n"
" MemCheck = ctest_memcheck results, in DynamicAnalysis.xml\n"
" Notes = Files listed by CTEST_NOTES_FILES, in Notes.xml\n"
" ExtraFiles = Files listed by CTEST_EXTRA_SUBMIT_FILES\n"
" Submit = nothing\n"
"The FILES option explicitly lists specific files to be submitted. "
"Each individual file must exist at the time of the call.\n"
"The RETRY_DELAY option specifies how long in seconds to wait after "
"a timed-out submission before attempting to re-submit.\n"
"The RETRY_COUNT option specifies how many times to retry a timed-out "
"submission.\n";
}
cmTypeMacro(cmCTestSubmitCommand, cmCTestHandlerCommand);
protected:

View File

@@ -41,45 +41,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_test";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Run tests in the project build tree.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_test([BUILD build_dir] [APPEND]\n"
" [START start number] [END end number]\n"
" [STRIDE stride number] [EXCLUDE exclude regex ]\n"
" [INCLUDE include regex] [RETURN_VALUE res] \n"
" [EXCLUDE_LABEL exclude regex] \n"
" [INCLUDE_LABEL label regex] \n"
" [PARALLEL_LEVEL level] \n"
" [SCHEDULE_RANDOM on] \n"
" [STOP_TIME time of day]) \n"
"Tests the given build directory and stores results in Test.xml. The "
"second argument is a variable that will hold value. Optionally, "
"you can specify the starting test number START, the ending test number "
"END, the number of tests to skip between each test STRIDE, a regular "
"expression for tests to run INCLUDE, or a regular expression for tests "
"to not run EXCLUDE. EXCLUDE_LABEL and INCLUDE_LABEL are regular "
"expression for test to be included or excluded by the test "
"property LABEL. PARALLEL_LEVEL should be set to a positive number "
"representing the number of tests to be run in parallel. "
"SCHEDULE_RANDOM will launch tests in a random order, and is "
"typically used to detect implicit test dependencies. STOP_TIME is the "
"time of day at which the tests should all stop running."
"\n"
CTEST_COMMAND_APPEND_OPTION_DOCS;
}
cmTypeMacro(cmCTestTestCommand, cmCTestHandlerCommand);
protected:

View File

@@ -61,10 +61,6 @@ public:
*/
virtual const char* GetName() const { return "subdirs";}
// Unused methods
virtual const char* GetTerseDocumentation() const { return ""; }
virtual const char* GetFullDocumentation() const { return ""; }
cmTypeMacro(cmCTestSubdirCommand, cmCommand);
cmCTestTestHandler* TestHandler;
@@ -162,10 +158,6 @@ public:
*/
virtual const char* GetName() const { return "add_subdirectory";}
// Unused methods
virtual const char* GetTerseDocumentation() const { return ""; }
virtual const char* GetFullDocumentation() const { return ""; }
cmTypeMacro(cmCTestAddSubdirectoryCommand, cmCommand);
cmCTestTestHandler* TestHandler;
@@ -252,10 +244,6 @@ public:
*/
virtual const char* GetName() const { return "add_test";}
// Unused methods
virtual const char* GetTerseDocumentation() const { return ""; }
virtual const char* GetFullDocumentation() const { return ""; }
cmTypeMacro(cmCTestAddTestCommand, cmCommand);
cmCTestTestHandler* TestHandler;
@@ -300,10 +288,6 @@ public:
*/
virtual const char* GetName() const { return "set_tests_properties";}
// Unused methods
virtual const char* GetTerseDocumentation() const { return ""; }
virtual const char* GetFullDocumentation() const { return ""; }
cmTypeMacro(cmCTestSetTestsPropertiesCommand, cmCommand);
cmCTestTestHandler* TestHandler;

View File

@@ -41,28 +41,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_update";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Update the work tree from version control.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_update([SOURCE source] [RETURN_VALUE res])\n"
"Updates the given source directory and stores results in Update.xml. "
"If no SOURCE is given, the CTEST_SOURCE_DIRECTORY variable is used. "
"The RETURN_VALUE option specifies a variable in which to store the "
"result, which is the number of files updated or -1 on error."
;
}
cmTypeMacro(cmCTestUpdateCommand, cmCTestHandlerCommand);
protected:

View File

@@ -45,25 +45,6 @@ public:
*/
virtual const char* GetName() const { return "ctest_upload";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Upload files to a dashboard server.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" ctest_upload(FILES ...)\n"
"Pass a list of files to be sent along with the build results to "
"the dashboard server.\n";
}
cmTypeMacro(cmCTestUploadCommand, cmCTestHandlerCommand);
protected:

View File

@@ -23,47 +23,27 @@
#include <form.h>
//----------------------------------------------------------------------------
static const char * cmDocumentationName[][3] =
static const char * cmDocumentationName[][2] =
{
{0,
" ccmake - Curses Interface for CMake.", 0},
{0,0,0}
" ccmake - Curses Interface for CMake."},
{0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationUsage[][3] =
static const char * cmDocumentationUsage[][2] =
{
{0,
" ccmake <path-to-source>\n"
" ccmake <path-to-existing-build>", 0},
{0,0,0}
" ccmake <path-to-existing-build>"},
{0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationDescription[][3] =
{
{0,
"The \"ccmake\" executable is the CMake curses interface. Project "
"configuration settings may be specified interactively through "
"this GUI. Brief instructions are provided at the bottom of the "
"terminal when the program is running.", 0},
CMAKE_STANDARD_INTRODUCTION,
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationOptions[][3] =
static const char * cmDocumentationOptions[][2] =
{
CMAKE_STANDARD_OPTIONS_TABLE,
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationSeeAlso[][3] =
{
{0, "cmake", 0},
{0, "ctest", 0},
{0, 0, 0}
{0,0}
};
cmCursesForm* cmCursesForm::CurrentForm=0;
@@ -106,21 +86,13 @@ int main(int argc, char** argv)
if(doc.CheckOptions(argc, argv))
{
cmake hcm;
std::vector<cmDocumentationEntry> commands;
std::vector<cmDocumentationEntry> compatCommands;
std::vector<cmDocumentationEntry> generators;
hcm.GetCommandDocumentation(commands, true, false);
hcm.GetCommandDocumentation(compatCommands, false, true);
hcm.GetGeneratorDocumentation(generators);
doc.SetName("ccmake");
doc.SetSection("Name",cmDocumentationName);
doc.SetSection("Usage",cmDocumentationUsage);
doc.SetSection("Description",cmDocumentationDescription);
doc.SetSection("Generators",generators);
doc.PrependSection("Options",cmDocumentationOptions);
doc.SetSection("Command",commands);
doc.SetSection("Compatibility Commands",compatCommands);
doc.SetSeeAlsoList(cmDocumentationSeeAlso);
return doc.PrintRequestedDocumentation(std::cout)? 0:1;
}

View File

@@ -23,39 +23,27 @@
#include <cmsys/SystemTools.hxx>
//----------------------------------------------------------------------------
static const char * cmDocumentationName[][3] =
static const char * cmDocumentationName[][2] =
{
{0,
" cmake-gui - CMake GUI.", 0},
{0,0,0}
" cmake-gui - CMake GUI."},
{0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationUsage[][3] =
static const char * cmDocumentationUsage[][2] =
{
{0,
" cmake-gui [options]\n"
" cmake-gui [options] <path-to-source>\n"
" cmake-gui [options] <path-to-existing-build>", 0},
{0,0,0}
" cmake-gui [options] <path-to-existing-build>"},
{0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationDescription[][3] =
static const char * cmDocumentationOptions[][2] =
{
{0,
"The \"cmake-gui\" executable is the CMake GUI. Project "
"configuration settings may be specified interactively. "
"Brief instructions are provided at the bottom of the "
"window when the program is running.", 0},
CMAKE_STANDARD_INTRODUCTION,
{0,0,0}
};
//----------------------------------------------------------------------------
static const char * cmDocumentationOptions[][3] =
{
{0,0,0}
{0,0}
};
int main(int argc, char** argv)
@@ -76,24 +64,14 @@ int main(int argc, char** argv)
{
doc.SetCMakeRoot(root);
}
std::vector<cmDocumentationEntry> commands;
std::vector<cmDocumentationEntry> compatCommands;
std::map<std::string,cmDocumentationSection *> propDocs;
std::vector<cmDocumentationEntry> generators;
hcm.GetCommandDocumentation(commands, true, false);
hcm.GetCommandDocumentation(compatCommands, false, true);
hcm.GetGeneratorDocumentation(generators);
hcm.GetPropertiesDocumentation(propDocs);
doc.SetName("cmake");
doc.SetSection("Name",cmDocumentationName);
doc.SetSection("Usage",cmDocumentationUsage);
doc.SetSection("Description",cmDocumentationDescription);
doc.AppendSection("Generators",generators);
doc.PrependSection("Options",cmDocumentationOptions);
doc.SetSection("Commands",commands);
doc.SetSection("Compatilbility Commands", compatCommands);
doc.SetSections(propDocs);
return (doc.PrintRequestedDocumentation(std::cout)? 0:1);
}

View File

@@ -13,7 +13,6 @@
#define cmAddCompileOptionsCommand_h
#include "cmCommand.h"
#include "cmDocumentGeneratorExpressions.h"
class cmAddCompileOptionsCommand : public cmCommand
{
@@ -38,33 +37,6 @@ public:
*/
virtual const char* GetName() const {return "add_compile_options";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Adds options to the compilation of source files.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" add_compile_options(<option> ...)\n"
"Adds options to the compiler command line for sources in the "
"current directory and below. This command can be used to add any "
"options, but alternative commands exist to add preprocessor "
"definitions or include directories. "
"See documentation of the directory and target COMPILE_OPTIONS "
"properties for details. "
"Arguments to add_compile_options may use \"generator "
"expressions\" with the syntax \"$<...>\". "
CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
;
}
cmTypeMacro(cmAddCompileOptionsCommand, cmCommand);
};

View File

@@ -13,7 +13,6 @@
#define cmAddCustomCommandCommand_h
#include "cmCommand.h"
#include "cmDocumentGeneratorExpressions.h"
/** \class cmAddCustomCommandCommand
* \brief cmAddCustomCommandCommand defines a new command (rule) that can
@@ -44,141 +43,6 @@ public:
*/
virtual const char* GetName() const {return "add_custom_command";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Add a custom build rule to the generated build system.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
"There are two main signatures for add_custom_command "
"The first signature is for adding a custom command "
"to produce an output.\n"
" add_custom_command(OUTPUT output1 [output2 ...]\n"
" COMMAND command1 [ARGS] [args1...]\n"
" [COMMAND command2 [ARGS] [args2...] ...]\n"
" [MAIN_DEPENDENCY depend]\n"
" [DEPENDS [depends...]]\n"
" [IMPLICIT_DEPENDS <lang1> depend1\n"
" [<lang2> depend2] ...]\n"
" [WORKING_DIRECTORY dir]\n"
" [COMMENT comment] [VERBATIM] [APPEND])\n"
"This defines a command to generate specified OUTPUT file(s). "
"A target created in the same directory (CMakeLists.txt file) that "
"specifies any output of the custom command as a source file is given "
"a rule to generate the file using the command at build time. "
"Do not list the output in more than one independent target that may "
"build in parallel or the two instances of the rule may conflict "
"(instead use add_custom_target to drive the command and make the "
"other targets depend on that one). "
"If an output name is a relative path it will be interpreted "
"relative to the build tree directory corresponding to the current "
"source directory. "
"Note that MAIN_DEPENDENCY is completely optional and is "
"used as a suggestion to visual studio about where to hang the "
"custom command. In makefile terms this creates a new target in the "
"following form:\n"
" OUTPUT: MAIN_DEPENDENCY DEPENDS\n"
" COMMAND\n"
"If more than one command is specified they will be executed in order. "
"The optional ARGS argument is for backward compatibility and will be "
"ignored.\n"
"The second signature adds a custom command to a target "
"such as a library or executable. This is useful for "
"performing an operation before or after building the target. "
"The command becomes part of the target and will only execute "
"when the target itself is built. If the target is already built,"
" the command will not execute.\n"
" add_custom_command(TARGET target\n"
" PRE_BUILD | PRE_LINK | POST_BUILD\n"
" COMMAND command1 [ARGS] [args1...]\n"
" [COMMAND command2 [ARGS] [args2...] ...]\n"
" [WORKING_DIRECTORY dir]\n"
" [COMMENT comment] [VERBATIM])\n"
"This defines a new command that will be associated with "
"building the specified target. When the command will "
"happen is determined by which of the following is specified:\n"
" PRE_BUILD - run before all other dependencies\n"
" PRE_LINK - run after other dependencies\n"
" POST_BUILD - run after the target has been built\n"
"Note that the PRE_BUILD option is only supported on Visual "
"Studio 7 or later. For all other generators PRE_BUILD "
"will be treated as PRE_LINK.\n"
"If WORKING_DIRECTORY is specified the command will be executed "
"in the directory given. "
"If it is a relative path it will be interpreted relative to the "
"build tree directory corresponding to the current source directory. "
"If COMMENT is set, the value will be displayed as a "
"message before the commands are executed at build time. "
"If APPEND is specified the COMMAND and DEPENDS option values "
"are appended to the custom command for the first output specified. "
"There must have already been a previous call to this command with "
"the same output. The COMMENT, WORKING_DIRECTORY, and MAIN_DEPENDENCY "
"options are currently ignored when APPEND is given, "
"but may be used in the future."
"\n"
"If VERBATIM is given then all arguments to the commands will be "
"escaped properly for the build tool so that the invoked command "
"receives each argument unchanged. "
"Note that one level of escapes is still used by the CMake language "
"processor before add_custom_command even sees the arguments. "
"Use of VERBATIM is recommended as it enables correct behavior. "
"When VERBATIM is not given the behavior is platform specific because "
"there is no protection of tool-specific special characters."
"\n"
"If the output of the custom command is not actually "
"created as a file on disk it should be marked as SYMBOLIC with "
"SET_SOURCE_FILES_PROPERTIES.\n"
"The IMPLICIT_DEPENDS option requests scanning of implicit "
"dependencies of an input file. The language given specifies the "
"programming language whose corresponding dependency scanner should "
"be used. Currently only C and CXX language scanners are supported. "
"The language has to be specified for every file in the "
"IMPLICIT_DEPENDS list. "
"Dependencies discovered from the scanning are added to those of "
"the custom command at build time. Note that the IMPLICIT_DEPENDS "
"option is currently supported only for Makefile generators and "
"will be ignored by other generators."
"\n"
"If COMMAND specifies an executable target (created by "
"ADD_EXECUTABLE) it will automatically be replaced by the location "
"of the executable created at build time. Additionally a "
"target-level dependency will be added so that the executable target "
"will be built before any target using this custom command. However "
"this does NOT add a file-level dependency that would cause the "
"custom command to re-run whenever the executable is recompiled."
"\n"
"Arguments to COMMAND may use \"generator expressions\" with the "
"syntax \"$<...>\". "
CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
"References to target names in generator expressions imply "
"target-level dependencies, but NOT file-level dependencies. "
"List target names with the DEPENDS option to add file dependencies."
"\n"
"The DEPENDS option specifies files on which the command depends. "
"If any dependency is an OUTPUT of another custom command in the "
"same directory (CMakeLists.txt file) CMake automatically brings the "
"other custom command into the target in which this command is built. "
"If DEPENDS is not specified the command will run whenever the OUTPUT "
"is missing; if the command does not actually create the OUTPUT then "
"the rule will always run. "
"If DEPENDS specifies any target (created by an ADD_* command) "
"a target-level dependency is created to make sure the target is "
"built before any target using this custom command. Additionally, "
"if the target is an executable or library a file-level dependency "
"is created to cause the custom command to re-run whenever the target "
"is recompiled.\n"
;
}
cmTypeMacro(cmAddCustomCommandCommand, cmCommand);
protected:
bool CheckOutputs(const std::vector<std::string>& outputs);

View File

@@ -45,63 +45,6 @@ public:
virtual const char* GetName() const
{return "add_custom_target";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Add a target with no output so it will always be built.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" add_custom_target(Name [ALL] [command1 [args1...]]\n"
" [COMMAND command2 [args2...] ...]\n"
" [DEPENDS depend depend depend ... ]\n"
" [WORKING_DIRECTORY dir]\n"
" [COMMENT comment] [VERBATIM]\n"
" [SOURCES src1 [src2...]])\n"
"Adds a target with the given name that executes the given commands. "
"The target has no output file and is ALWAYS CONSIDERED OUT OF DATE "
"even if the commands try to create a file with the name of the "
"target. Use ADD_CUSTOM_COMMAND to generate a file with dependencies. "
"By default nothing depends on the custom target. Use "
"ADD_DEPENDENCIES to add dependencies to or from other targets. "
"If the ALL option is specified "
"it indicates that this target should be added to the default build "
"target so that it will be run every time "
"(the command cannot be called ALL). "
"The command and arguments are optional and if not specified an "
"empty target will be created. "
"If WORKING_DIRECTORY is set, then the command will be run in that "
"directory. "
"If it is a relative path it will be interpreted relative to the "
"build tree directory corresponding to the current source directory. "
"If COMMENT is set, the value will be displayed as a "
"message before the commands are executed at build time. "
"Dependencies listed with the DEPENDS argument may reference files "
"and outputs of custom commands created with add_custom_command() in "
"the same directory (CMakeLists.txt file).\n"
"If VERBATIM is given then all arguments to the commands will be "
"escaped properly for the build tool so that the invoked command "
"receives each argument unchanged. "
"Note that one level of escapes is still used by the CMake language "
"processor before add_custom_target even sees the arguments. "
"Use of VERBATIM is recommended as it enables correct behavior. "
"When VERBATIM is not given the behavior is platform specific because "
"there is no protection of tool-specific special characters."
"\n"
"The SOURCES option specifies additional source files to be included "
"in the custom target. "
"Specified source files will be added to IDE project files for "
"convenience in editing even if they have not build rules."
;
}
cmTypeMacro(cmAddCustomTargetCommand, cmCommand);
};

View File

@@ -43,35 +43,6 @@ public:
*/
virtual const char* GetName() const {return "add_definitions";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Adds -D define flags to the compilation of source files.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" add_definitions(-DFOO -DBAR ...)\n"
"Adds flags to the compiler command line for sources in the current "
"directory and below. This command can be used to add any flags, "
"but it was originally intended to add preprocessor definitions. "
"Flags beginning in -D or /D that look like preprocessor definitions "
"are automatically added to the COMPILE_DEFINITIONS property for "
"the current directory. Definitions with non-trivial values may be "
"left in the set of flags instead of being converted for reasons of "
"backwards compatibility. See documentation of the directory, "
"target, and source file COMPILE_DEFINITIONS properties for details "
"on adding preprocessor definitions to specific scopes and "
"configurations."
;
}
cmTypeMacro(cmAddDefinitionsCommand, cmCommand);
};

View File

@@ -42,35 +42,6 @@ public:
*/
virtual const char* GetName() const { return "add_dependencies";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Add a dependency between top-level targets.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" add_dependencies(<target> [<target-dependency>]...)\n"
"Make a top-level <target> depend on other top-level targets to "
"ensure that they build before <target> does. "
"A top-level target is one created by ADD_EXECUTABLE, ADD_LIBRARY, "
"or ADD_CUSTOM_TARGET. "
"Dependencies added to an IMPORTED target are followed transitively "
"in its place since the target itself does not build. "
"\n"
"See the DEPENDS option of ADD_CUSTOM_TARGET "
"and ADD_CUSTOM_COMMAND for adding file-level dependencies in custom "
"rules. See the OBJECT_DEPENDS option in "
"SET_SOURCE_FILES_PROPERTIES to add file-level dependencies to object "
"files.";
}
cmTypeMacro(cmAddDependenciesCommand, cmCommand);
};

View File

@@ -43,86 +43,6 @@ public:
*/
virtual const char* GetName() const { return "add_executable";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return
"Add an executable to the project using the specified source files.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" add_executable(<name> [WIN32] [MACOSX_BUNDLE]\n"
" [EXCLUDE_FROM_ALL]\n"
" source1 source2 ... sourceN)\n"
"Adds an executable target called <name> to be built from the "
"source files listed in the command invocation. "
"The <name> corresponds to the logical target name and must be "
"globally unique within a project. "
"The actual file name of the executable built is constructed based on "
"conventions of the native platform "
"(such as <name>.exe or just <name>). "
"\n"
"By default the executable file will be created in the build tree "
"directory corresponding to the source tree directory in which "
"the command was invoked. "
"See documentation of the RUNTIME_OUTPUT_DIRECTORY "
"target property to change this location. "
"See documentation of the OUTPUT_NAME target property to change "
"the <name> part of the final file name. "
"\n"
"If WIN32 is given the property WIN32_EXECUTABLE will be set on the "
"target created. "
"See documentation of that target property for details."
"\n"
"If MACOSX_BUNDLE is given the corresponding property will be "
"set on the created target. "
"See documentation of the MACOSX_BUNDLE target property for details."
"\n"
"If EXCLUDE_FROM_ALL is given the corresponding property will be "
"set on the created target. "
"See documentation of the EXCLUDE_FROM_ALL target property for "
"details."
"\n"
"The add_executable command can also create IMPORTED executable "
"targets using this signature:\n"
" add_executable(<name> IMPORTED [GLOBAL])\n"
"An IMPORTED executable target references an executable file located "
"outside the project. "
"No rules are generated to build it. "
"The target name has scope in the directory in which it is created "
"and below, but the GLOBAL option extends visibility. "
"It may be referenced like any target built within the project. "
"IMPORTED executables are useful for convenient reference from "
"commands like add_custom_command. "
"Details about the imported executable are specified by setting "
"properties whose names begin in \"IMPORTED_\". "
"The most important such property is IMPORTED_LOCATION "
"(and its per-configuration version IMPORTED_LOCATION_<CONFIG>) "
"which specifies the location of the main executable file on disk. "
"See documentation of the IMPORTED_* properties for more information."
"\n"
"The signature\n"
" add_executable(<name> ALIAS <target>)\n"
"creates an alias, such that <name> can be used to refer to <target> "
"in subsequent commands. The <name> does not appear in the generated "
"buildsystem as a make target. The <target> may not be an IMPORTED "
"target or an ALIAS. Alias targets can be used as linkable targets, "
"targets to read properties from, executables for custom commands and "
"custom targets. They can also be tested for existance with the "
"regular if(TARGET) subcommand. The <name> may not be used to modify "
"properties of <target>, that is, it may not be used as the operand of "
"set_property, set_target_properties, target_link_libraries etc. An "
"ALIAS target may not be installed of exported."
;
}
cmTypeMacro(cmAddExecutableCommand, cmCommand);
};

View File

@@ -43,127 +43,6 @@ public:
*/
virtual const char* GetName() const { return "add_library";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Add a library to the project using the specified source files.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" add_library(<name> [STATIC | SHARED | MODULE]\n"
" [EXCLUDE_FROM_ALL]\n"
" source1 source2 ... sourceN)\n"
"Adds a library target called <name> to be built from the "
"source files listed in the command invocation. "
"The <name> corresponds to the logical target name and must be "
"globally unique within a project. "
"The actual file name of the library built is constructed based on "
"conventions of the native platform "
"(such as lib<name>.a or <name>.lib)."
"\n"
"STATIC, SHARED, or MODULE may be given to specify the type of library "
"to be created. "
"STATIC libraries are archives of object files for use when linking "
"other targets. "
"SHARED libraries are linked dynamically and loaded at runtime. "
"MODULE libraries are plugins that are not linked into other targets "
"but may be loaded dynamically at runtime using dlopen-like "
"functionality. "
"If no type is given explicitly the type is STATIC or SHARED based "
"on whether the current value of the variable BUILD_SHARED_LIBS is "
"true. "
"For SHARED and MODULE libraries the POSITION_INDEPENDENT_CODE "
"target property is set to TRUE automatically."
"\n"
"By default the library file will be created in the build tree "
"directory corresponding to the source tree directory in which "
"the command was invoked. "
"See documentation of the ARCHIVE_OUTPUT_DIRECTORY, "
"LIBRARY_OUTPUT_DIRECTORY, and RUNTIME_OUTPUT_DIRECTORY "
"target properties to change this location. "
"See documentation of the OUTPUT_NAME target property to change "
"the <name> part of the final file name. "
"\n"
"If EXCLUDE_FROM_ALL is given the corresponding property will be "
"set on the created target. "
"See documentation of the EXCLUDE_FROM_ALL target property for "
"details."
"\n"
"The add_library command can also create IMPORTED library "
"targets using this signature:\n"
" add_library(<name> <SHARED|STATIC|MODULE|UNKNOWN> IMPORTED\n"
" [GLOBAL])\n"
"An IMPORTED library target references a library file located "
"outside the project. "
"No rules are generated to build it. "
"The target name has scope in the directory in which it is created "
"and below, but the GLOBAL option extends visibility. "
"It may be referenced like any target built within the project. "
"IMPORTED libraries are useful for convenient reference from "
"commands like target_link_libraries. "
"Details about the imported library are specified by setting "
"properties whose names begin in \"IMPORTED_\". "
"The most important such property is IMPORTED_LOCATION "
"(and its per-configuration version IMPORTED_LOCATION_<CONFIG>) "
"which specifies the location of the main library file on disk. "
"See documentation of the IMPORTED_* properties for more information."
"\n"
"The signature\n"
" add_library(<name> OBJECT <src>...)\n"
"creates a special \"object library\" target. "
"An object library compiles source files but does not archive or link "
"their object files into a library. "
"Instead other targets created by add_library or add_executable may "
"reference the objects using an expression of the form "
"$<TARGET_OBJECTS:objlib> as a source, where \"objlib\" is the "
"object library name. "
"For example:\n"
" add_library(... $<TARGET_OBJECTS:objlib> ...)\n"
" add_executable(... $<TARGET_OBJECTS:objlib> ...)\n"
"will include objlib's object files in a library and an executable "
"along with those compiled from their own sources. "
"Object libraries may contain only sources (and headers) that compile "
"to object files. "
"They may contain custom commands generating such sources, but not "
"PRE_BUILD, PRE_LINK, or POST_BUILD commands. "
"Object libraries cannot be imported, exported, installed, or linked."
" "
"Some native build systems may not like targets that have only "
"object files, so consider adding at least one real source file "
"to any target that references $<TARGET_OBJECTS:objlib>."
"\n"
"The signature\n"
" add_library(<name> ALIAS <target>)\n"
"creates an alias, such that <name> can be used to refer to <target> "
"in subsequent commands. The <name> does not appear in the generated "
"buildsystem as a make target. The <target> may not be an IMPORTED "
"target or an ALIAS. Alias targets can be used as linkable targets, "
"targets to read properties from. They can also be tested for "
"existance with the "
"regular if(TARGET) subcommand. The <name> may not be used to modify "
"properties of <target>, that is, it may not be used as the operand of "
"set_property, set_target_properties, target_link_libraries etc. An "
"ALIAS target may not be installed of exported."
"\n"
"The signature\n"
" add_library(<name> INTERFACE)\n"
"creates an interface target. An interface target does not directly "
"create build output, though it may have properties set on it and it "
"may be installed, exported and imported. Typically the INTERFACE_* "
"properties are populated on the interface target using the "
"set_property(), target_link_libraries(), target_include_directories() "
"and target_compile_defintions() commands, and then it is used as an "
"argument to target_link_libraries() like any other target."
;
}
cmTypeMacro(cmAddLibraryCommand, cmCommand);
};

View File

@@ -44,53 +44,6 @@ public:
*/
virtual const char* GetName() const { return "add_subdirectory";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Add a subdirectory to the build.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" add_subdirectory(source_dir [binary_dir] \n"
" [EXCLUDE_FROM_ALL])\n"
"Add a subdirectory to the build. The source_dir specifies the "
"directory in which the source CMakeLists.txt and code files are "
"located. If it is a relative "
"path it will be evaluated with respect to the current "
"directory (the typical usage), but it may also be an absolute path. "
"The binary_dir specifies the directory in which to place the output "
"files. If it is a relative path it will be evaluated with respect "
"to the current output directory, but it may also be an absolute "
"path. If binary_dir is not specified, the value of source_dir, "
"before expanding any relative path, will be used (the typical usage). "
"The CMakeLists.txt file in the specified source directory will "
"be processed immediately by CMake before processing in the current "
"input file continues beyond this command.\n"
"If the EXCLUDE_FROM_ALL argument is provided then targets in the "
"subdirectory will not be included in the ALL target of the parent "
"directory by default, and will be excluded from IDE project files. "
"Users must explicitly build targets in the subdirectory. "
"This is meant for use when the subdirectory contains a separate part "
"of the project that is useful but not necessary, such as a set of "
"examples. "
"Typically the subdirectory should contain its own project() command "
"invocation so that a full build system will be generated in the "
"subdirectory (such as a VS IDE solution file). "
"Note that inter-target dependencies supercede this exclusion. "
"If a target built by the parent project depends on a target in the "
"subdirectory, the dependee target will be included in the parent "
"project build system to satisfy the dependency."
;
}
cmTypeMacro(cmAddSubDirectoryCommand, cmCommand);
};

View File

@@ -13,7 +13,6 @@
#define cmAddTestCommand_h
#include "cmCommand.h"
#include "cmDocumentGeneratorExpressions.h"
/** \class cmAddTestCommand
* \brief Add a test to the lists of tests to run.
@@ -43,59 +42,6 @@ public:
*/
virtual const char* GetName() const { return "add_test";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Add a test to the project with the specified arguments.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" add_test(testname Exename arg1 arg2 ... )\n"
"If the ENABLE_TESTING command has been run, this command adds a "
"test target to the current directory. If ENABLE_TESTING has not "
"been run, this command does nothing. "
"The tests are run by the testing subsystem by executing Exename "
"with the specified arguments. Exename can be either an executable "
"built by this project or an arbitrary executable on the "
"system (like tclsh). The test will be run with the current working "
"directory set to the CMakeList.txt files corresponding directory "
"in the binary tree. Tests added using this signature do not support "
"generator expressions.\n"
"\n"
" add_test(NAME <name> [CONFIGURATIONS [Debug|Release|...]]\n"
" [WORKING_DIRECTORY dir]\n"
" COMMAND <command> [arg1 [arg2 ...]])\n"
"Add a test called <name>. "
"The test name may not contain spaces, quotes, or other characters "
"special in CMake syntax. "
"If COMMAND specifies an executable target (created by "
"add_executable) it will automatically be replaced by the location "
"of the executable created at build time. "
"If a CONFIGURATIONS option is given then the test will be executed "
"only when testing under one of the named configurations. "
"If a WORKING_DIRECTORY option is given then the test will be executed "
"in the given directory."
"\n"
"Arguments after COMMAND may use \"generator expressions\" with the "
"syntax \"$<...>\". "
CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS
"Example usage:\n"
" add_test(NAME mytest\n"
" COMMAND testDriver --config $<CONFIGURATION>\n"
" --exe $<TARGET_FILE:myexe>)\n"
"This creates a test \"mytest\" whose command runs a testDriver "
"tool passing the configuration name and the full path to the "
"executable file produced by target \"myexe\"."
;
}
cmTypeMacro(cmAddTestCommand, cmCommand);
private:
bool HandleNameMode(std::vector<std::string> const& args);

View File

@@ -46,38 +46,6 @@ public:
*/
virtual const char* GetName() const { return "aux_source_directory";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Find all source files in a directory.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" aux_source_directory(<dir> <variable>)\n"
"Collects the names of all the source files in the specified "
"directory and stores the list in the <variable> provided. This "
"command is intended to be used by projects that use explicit "
"template instantiation. Template instantiation files can be "
"stored in a \"Templates\" subdirectory and collected automatically "
"using this command to avoid manually listing all instantiations.\n"
"It is tempting to use this command to avoid writing the list of "
"source files for a library or executable target. While this seems "
"to work, there is no way for CMake to generate a build system that "
"knows when a new source file has been added. Normally the "
"generated build system knows when it needs to rerun CMake because "
"the CMakeLists.txt file is modified to add a new source. When the "
"source is just added to the directory without modifying this file, "
"one would have to manually rerun CMake to generate a build system "
"incorporating the new file.";
}
cmTypeMacro(cmAuxSourceDirectoryCommand, cmCommand);
};

View File

@@ -47,24 +47,6 @@ public:
*/
virtual const char* GetName() const {return "break";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Break from an enclosing foreach or while loop.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" break()\n"
"Breaks from an enclosing foreach loop or while loop";
}
cmTypeMacro(cmBreakCommand, cmCommand);
};

View File

@@ -52,45 +52,6 @@ public:
*/
virtual const char* GetName() const {return "build_command";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Get the command line to build this project.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" build_command(<variable>\n"
" [CONFIGURATION <config>]\n"
" [PROJECT_NAME <projname>]\n"
" [TARGET <target>])\n"
"Sets the given <variable> to a string containing the command line "
"for building one configuration of a target in a project using the "
"build tool appropriate for the current CMAKE_GENERATOR.\n"
"If CONFIGURATION is omitted, CMake chooses a reasonable default "
"value for multi-configuration generators. CONFIGURATION is "
"ignored for single-configuration generators.\n"
"If PROJECT_NAME is omitted, the resulting command line will build "
"the top level PROJECT in the current build tree.\n"
"If TARGET is omitted, the resulting command line will build "
"everything, effectively using build target 'all' or 'ALL_BUILD'.\n"
" build_command(<cachevariable> <makecommand>)\n"
"This second signature is deprecated, but still available for "
"backwards compatibility. Use the first signature instead.\n"
"Sets the given <cachevariable> to a string containing the command "
"to build this project from the root of the build tree using "
"the build tool given by <makecommand>. <makecommand> should be "
"the full path to msdev, devenv, nmake, make or one of the end "
"user build tools."
;
}
cmTypeMacro(cmBuildCommand, cmCommand);
};

View File

@@ -47,27 +47,6 @@ public:
*/
virtual const char* GetName() const {return "build_name";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return
"Deprecated. Use ${CMAKE_SYSTEM} and ${CMAKE_CXX_COMPILER} instead.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" build_name(variable)\n"
"Sets the specified variable to a string representing the platform "
"and compiler settings. These values are now available through the "
"CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables.";
}
/** This command is kept for compatibility with older CMake versions. */
virtual bool IsDiscouraged() const
{

View File

@@ -53,41 +53,6 @@ public:
return "cmake_host_system_information";
}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Query host system specific information.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" cmake_host_system_information(RESULT <variable> QUERY <key> ...)\n"
"Queries system information of the host system on which cmake runs. "
"One or more <key> can be provided to "
"select the information to be queried. "
"The list of queried values is stored in <variable>.\n"
"<key> can be one of the following values:\n"
" NUMBER_OF_LOGICAL_CORES = Number of logical cores.\n"
" NUMBER_OF_PHYSICAL_CORES = Number of physical cores.\n"
" HOSTNAME = Hostname.\n"
" FQDN = Fully qualified domain name.\n"
" TOTAL_VIRTUAL_MEMORY = "
"Total virtual memory in megabytes.\n"
" AVAILABLE_VIRTUAL_MEMORY = "
"Available virtual memory in megabytes.\n"
" TOTAL_PHYSICAL_MEMORY = "
"Total physical memory in megabytes.\n"
" AVAILABLE_PHYSICAL_MEMORY = "
"Available physical memory in megabytes.\n"
;
}
cmTypeMacro(cmCMakeHostSystemInformationCommand, cmCommand);
private:

View File

@@ -47,37 +47,6 @@ public:
*/
virtual const char* GetName() const {return "cmake_minimum_required";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Set the minimum required version of cmake for a project.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" cmake_minimum_required(VERSION major[.minor[.patch[.tweak]]]\n"
" [FATAL_ERROR])\n"
"If the current version of CMake is lower than that required "
"it will stop processing the project and report an error. "
"When a version higher than 2.4 is specified the command implicitly "
"invokes\n"
" cmake_policy(VERSION major[.minor[.patch[.tweak]]])\n"
"which sets the cmake policy version level to the version specified. "
"When version 2.4 or lower is given the command implicitly invokes\n"
" cmake_policy(VERSION 2.4)\n"
"which enables compatibility features for CMake 2.4 and lower.\n"
"The FATAL_ERROR option is accepted but ignored by CMake 2.6 "
"and higher. "
"It should be specified so CMake versions 2.4 and lower fail with an "
"error instead of just a warning.";
}
cmTypeMacro(cmCMakeMinimumRequired, cmCommand);
private:

View File

@@ -48,88 +48,6 @@ public:
*/
virtual const char* GetName() const {return "cmake_policy";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Manage CMake Policy settings.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
"As CMake evolves it is sometimes necessary to change existing "
"behavior in order to fix bugs or improve implementations of "
"existing features. "
"The CMake Policy mechanism is designed to help keep existing projects "
"building as new versions of CMake introduce changes in behavior. "
"Each new policy (behavioral change) is given an identifier of "
"the form \"CMP<NNNN>\" where \"<NNNN>\" is an integer index. "
"Documentation associated with each policy describes the OLD and NEW "
"behavior and the reason the policy was introduced. "
"Projects may set each policy to select the desired behavior. "
"When CMake needs to know which behavior to use it checks for "
"a setting specified by the project. "
"If no setting is available the OLD behavior is assumed and a warning "
"is produced requesting that the policy be set.\n"
"The cmake_policy command is used to set policies to OLD or NEW "
"behavior. "
"While setting policies individually is supported, we encourage "
"projects to set policies based on CMake versions.\n"
" cmake_policy(VERSION major.minor[.patch[.tweak]])\n"
"Specify that the current CMake list file is written for the "
"given version of CMake. "
"All policies introduced in the specified version or earlier "
"will be set to use NEW behavior. "
"All policies introduced after the specified version will be unset "
"(unless variable CMAKE_POLICY_DEFAULT_CMP<NNNN> sets a default). "
"This effectively requests behavior preferred as of a given CMake "
"version and tells newer CMake versions to warn about their new "
"policies. "
"The policy version specified must be at least 2.4 or the command "
"will report an error. "
"In order to get compatibility features supporting versions earlier "
"than 2.4 see documentation of policy CMP0001."
"\n"
" cmake_policy(SET CMP<NNNN> NEW)\n"
" cmake_policy(SET CMP<NNNN> OLD)\n"
"Tell CMake to use the OLD or NEW behavior for a given policy. "
"Projects depending on the old behavior of a given policy may "
"silence a policy warning by setting the policy state to OLD. "
"Alternatively one may fix the project to work with the new behavior "
"and set the policy state to NEW."
"\n"
" cmake_policy(GET CMP<NNNN> <variable>)\n"
"Check whether a given policy is set to OLD or NEW behavior. "
"The output variable value will be \"OLD\" or \"NEW\" if the "
"policy is set, and empty otherwise."
"\n"
"CMake keeps policy settings on a stack, so changes made by the "
"cmake_policy command affect only the top of the stack. "
"A new entry on the policy stack is managed automatically for each "
"subdirectory to protect its parents and siblings. "
"CMake also manages a new entry for scripts loaded by include() and "
"find_package() commands except when invoked with the NO_POLICY_SCOPE "
"option (see also policy CMP0011). "
"The cmake_policy command provides an interface to manage custom "
"entries on the policy stack:\n"
" cmake_policy(PUSH)\n"
" cmake_policy(POP)\n"
"Each PUSH must have a matching POP to erase any changes. "
"This is useful to make temporary changes to policy settings."
"\n"
"Functions and macros record policy settings when they are created "
"and use the pre-record policies when they are invoked. "
"If the function or macro implementation sets policies, the changes "
"automatically propagate up through callers until they reach the "
"closest nested policy stack entry."
;
}
cmTypeMacro(cmCMakePolicyCommand, cmCommand);
private:
bool HandleSetMode(std::vector<std::string> const& args);

View File

@@ -935,65 +935,3 @@ bool cmCacheManager::NeedCacheCompatibility(int major, int minor)
return (actual_compat &&
actual_compat <= CMake_VERSION_ENCODE(major, minor, 0));
}
//----------------------------------------------------------------------------
void cmCacheManager::DefineProperties(cmake *cm)
{
cm->DefineProperty
("ADVANCED", cmProperty::CACHE,
"True if entry should be hidden by default in GUIs.",
"This is a boolean value indicating whether the entry is considered "
"interesting only for advanced configuration. "
"The mark_as_advanced() command modifies this property."
);
cm->DefineProperty
("HELPSTRING", cmProperty::CACHE,
"Help associated with entry in GUIs.",
"This string summarizes the purpose of an entry to help users set it "
"through a CMake GUI."
);
cm->DefineProperty
("TYPE", cmProperty::CACHE,
"Widget type for entry in GUIs.",
"Cache entry values are always strings, but CMake GUIs present widgets "
"to help users set values. "
"The GUIs use this property as a hint to determine the widget type. "
"Valid TYPE values are:\n"
" BOOL = Boolean ON/OFF value.\n"
" PATH = Path to a directory.\n"
" FILEPATH = Path to a file.\n"
" STRING = Generic string value.\n"
" INTERNAL = Do not present in GUI at all.\n"
" STATIC = Value managed by CMake, do not change.\n"
" UNINITIALIZED = Type not yet specified.\n"
"Generally the TYPE of a cache entry should be set by the command "
"which creates it (set, option, find_library, etc.)."
);
cm->DefineProperty
("MODIFIED", cmProperty::CACHE,
"Internal management property. Do not set or get.",
"This is an internal cache entry property managed by CMake to "
"track interactive user modification of entries. Ignore it."
);
cm->DefineProperty
("STRINGS", cmProperty::CACHE,
"Enumerate possible STRING entry values for GUI selection.",
"For cache entries with type STRING, this enumerates a set of values. "
"CMake GUIs may use this to provide a selection widget instead of a "
"generic string entry field. "
"This is for convenience only. "
"CMake does not enforce that the value matches one of those listed."
);
cm->DefineProperty
("VALUE", cmProperty::CACHE,
"Value of a cache entry.",
"This property maps to the actual value of a cache entry. "
"Setting this property always sets the value without checking, so "
"use with care."
);
}

View File

@@ -149,9 +149,6 @@ public:
unsigned int GetCacheMinorVersion() { return this->CacheMinorVersion; }
bool NeedCacheCompatibility(int major, int minor);
/** Define and document CACHE entry properties. */
static void DefineProperties(cmake *cm);
protected:
///! Add an entry into the cache
void AddCacheEntry(const char* key, const char* value,

View File

@@ -126,16 +126,6 @@ public:
*/
virtual const char* GetName() const = 0;
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const = 0;
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const = 0;
/**
* Enable the command.
*/

View File

@@ -16,7 +16,6 @@
#cmakedefine HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE
#cmakedefine HAVE_UNSETENV
#cmakedefine CMAKE_USE_ELF_PARSER
#cmakedefine CMAKE_STRICT
#define CMAKE_ROOT_DIR "${CMake_SOURCE_DIR}"
#define CMAKE_BUILD_DIR "${CMake_BINARY_DIR}"
#define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"

View File

@@ -41,61 +41,6 @@ public:
*/
virtual bool IsScriptable() const { return true; }
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Copy a file to another location and modify its contents.";
}
/**
* Longer documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" configure_file(<input> <output>\n"
" [COPYONLY] [ESCAPE_QUOTES] [@ONLY] \n"
" [NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])\n"
"Copies a file <input> to file <output> and substitutes variable "
"values referenced in the file content. "
"If <input> is a relative path it is evaluated with respect to "
"the current source directory. "
"The <input> must be a file, not a directory. "
"If <output> is a relative path it is evaluated with respect to "
"the current binary directory. "
"If <output> names an existing directory the input file is placed "
"in that directory with its original name. "
"\n"
"If the <input> file is modified the build system will re-run CMake "
"to re-configure the file and generate the build system again."
"\n"
"This command replaces any variables in the input file referenced as "
"${VAR} or @VAR@ with their values as determined by CMake. If a "
"variable is not defined, it will be replaced with nothing. "
"If COPYONLY is specified, then no variable expansion will take "
"place. If ESCAPE_QUOTES is specified then any substituted quotes "
"will be C-style escaped. "
"The file will be configured with the current values of CMake "
"variables. If @ONLY is specified, only variables "
"of the form @VAR@ will be replaced and ${VAR} will be ignored. "
"This is useful for configuring scripts that use ${VAR}."
"\n"
"Input file lines of the form \"#cmakedefine VAR ...\" "
"will be replaced with either \"#define VAR ...\" or "
"\"/* #undef VAR */\" depending on whether VAR is set in CMake to "
"any value not considered a false constant by the if() command. "
"(Content of \"...\", if any, is processed as above.) "
"Input file lines of the form \"#cmakedefine01 VAR\" "
"will be replaced with either \"#define VAR 1\" or "
"\"#define VAR 0\" similarly."
"\n"
"With NEWLINE_STYLE the line ending could be adjusted: \n"
" 'UNIX' or 'LF' for \\n, 'DOS', 'WIN32' or 'CRLF' for \\r\\n.\n"
"COPYONLY must not be used with NEWLINE_STYLE.\n";
}
virtual void FinalPass();
virtual bool HasFinalPass() const { return !this->Immediate; }

View File

@@ -42,46 +42,6 @@ public:
*/
virtual const char* GetName() const {return "create_test_sourcelist";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Create a test driver and source list for building test programs.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" create_test_sourcelist(sourceListName driverName\n"
" test1 test2 test3\n"
" EXTRA_INCLUDE include.h\n"
" FUNCTION function)\n"
"A test driver is a program that links together many small tests into "
"a single executable. This is useful when building static executables "
"with large libraries to shrink the total required size. "
"The list of source files "
"needed to build the test driver will be in sourceListName. "
"DriverName is the name of the test driver program. The rest of "
"the arguments consist of a list of test source files, can be "
"semicolon separated. Each test source file should have a function in "
"it that is the same name as the file with no extension (foo.cxx "
"should have int foo(int, char*[]);) DriverName will be able to "
"call each of the "
"tests by name on the command line. If EXTRA_INCLUDE is specified, "
"then the next argument is included into the generated file. If "
"FUNCTION is specified, then the next argument is taken as a function "
"name that is passed a pointer to ac and av. This can be used to add "
"extra command line processing to each test. The cmake variable "
"CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code that will be "
"placed directly before calling the test main function. "
"CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be "
"placed directly after the call to the test main function.";
}
cmTypeMacro(cmCreateTestSourceList, cmCommand);
};

View File

@@ -12,7 +12,6 @@
#include "cmDefinePropertyCommand.h"
#include "cmake.h"
// cmDefinePropertiesCommand
bool cmDefinePropertyCommand
::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
{

View File

@@ -34,53 +34,6 @@ public:
*/
virtual const char* GetName() const { return "define_property";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Define and document custom properties.";
}
/**
* Longer documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |\n"
" TEST | VARIABLE | CACHED_VARIABLE>\n"
" PROPERTY <name> [INHERITED]\n"
" BRIEF_DOCS <brief-doc> [docs...]\n"
" FULL_DOCS <full-doc> [docs...])\n"
"Define one property in a scope for use with the "
"set_property and get_property commands. "
"This is primarily useful to associate documentation with property "
"names that may be retrieved with the get_property command. "
"The first argument determines the kind of scope in which the "
"property should be used. It must be one of the following:\n"
" GLOBAL = associated with the global namespace\n"
" DIRECTORY = associated with one directory\n"
" TARGET = associated with one target\n"
" SOURCE = associated with one source file\n"
" TEST = associated with a test named with add_test\n"
" VARIABLE = documents a CMake language variable\n"
" CACHED_VARIABLE = documents a CMake cache variable\n"
"Note that unlike set_property and get_property no actual scope "
"needs to be given; only the kind of scope is important.\n"
"The required PROPERTY option is immediately followed by the name "
"of the property being defined.\n"
"If the INHERITED option then the get_property command will chain "
"up to the next higher scope when the requested property is not "
"set in the scope given to the command. "
"DIRECTORY scope chains to GLOBAL. "
"TARGET, SOURCE, and TEST chain to DIRECTORY.\n"
"The BRIEF_DOCS and FULL_DOCS options are followed by strings to be "
"associated with the property as its brief and full documentation. "
"Corresponding options to the get_property command will retrieve the "
"documentation.";
}
cmTypeMacro(cmDefinePropertyCommand, cmCommand);
private:
std::string PropertyName;

View File

@@ -1,34 +0,0 @@
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2011 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.
============================================================================*/
#ifndef cmDocumentCompileDefinitions_h
#define cmDocumentCompileDefinitions_h
#define CM_DOCUMENT_COMPILE_DEFINITIONS_DISCLAIMER \
"Disclaimer: Most native build tools have poor support for escaping " \
"certain values. CMake has work-arounds for many cases but some " \
"values may just not be possible to pass correctly. If a value " \
"does not seem to be escaped correctly, do not attempt to " \
"work-around the problem by adding escape sequences to the value. " \
"Your work-around may break in a future version of CMake that " \
"has improved escape support. Instead consider defining the macro " \
"in a (configured) header file. Then report the limitation. " \
"Known limitations include:\n" \
" # - broken almost everywhere\n" \
" ; - broken in VS IDE 7.0 and Borland Makefiles\n" \
" , - broken in VS IDE\n" \
" % - broken in some cases in NMake\n" \
" & | - broken in some cases on MinGW\n" \
" ^ < > \\\" - broken in most Make tools on Windows\n" \
"CMake does not reject these values outright because they do work " \
"in some cases. Use with caution. "
#endif

View File

@@ -1,101 +0,0 @@
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2010 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.
============================================================================*/
#ifndef cmDocumentGeneratorExpressions_h
#define cmDocumentGeneratorExpressions_h
#define CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS \
"Generator expressions are evaluated during build system generation " \
"to produce information specific to each build configuration. " \
"Valid expressions are:\n" \
" $<0:...> = empty string (ignores \"...\")\n" \
" $<1:...> = content of \"...\"\n" \
" $<CONFIG:cfg> = '1' if config is \"cfg\", else '0'\n" \
" $<CONFIGURATION> = configuration name\n" \
" $<BOOL:...> = '1' if the '...' is true, else '0'\n" \
" $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'\n" \
" $<ANGLE-R> = A literal '>'. Used to compare " \
"strings which contain a '>' for example.\n" \
" $<COMMA> = A literal ','. Used to compare " \
"strings which contain a ',' for example.\n" \
" $<SEMICOLON> = A literal ';'. Used to prevent " \
"list expansion on an argument with ';'.\n" \
" $<JOIN:list,...> = joins the list with the content of " \
"\"...\"\n" \
" $<TARGET_NAME:...> = Marks ... as being the name of a " \
"target. This is required if exporting targets to multiple " \
"dependent export sets. The '...' must be a literal name of a " \
"target- it may not contain generator expressions.\n" \
" $<INSTALL_INTERFACE:...> = content of \"...\" when the property " \
"is exported using install(EXPORT), and empty otherwise.\n" \
" $<BUILD_INTERFACE:...> = content of \"...\" when the property " \
"is exported using export(), or when the target is used by another " \
"target in the same buildsystem. Expands to the empty string " \
"otherwise.\n" \
" $<PLATFORM_ID> = The CMake-id of the platform " \
" $<PLATFORM_ID:comp> = '1' if the The CMake-id of the " \
"platform matches comp, otherwise '0'.\n" \
" $<C_COMPILER_ID> = The CMake-id of the C compiler " \
"used.\n" \
" $<C_COMPILER_ID:comp> = '1' if the CMake-id of the C " \
"compiler matches comp, otherwise '0'.\n" \
" $<CXX_COMPILER_ID> = The CMake-id of the CXX compiler " \
"used.\n" \
" $<CXX_COMPILER_ID:comp> = '1' if the CMake-id of the CXX " \
"compiler matches comp, otherwise '0'.\n" \
" $<VERSION_GREATER:v1,v2> = '1' if v1 is a version greater than " \
"v2, else '0'.\n" \
" $<VERSION_LESS:v1,v2> = '1' if v1 is a version less than v2, " \
"else '0'.\n" \
" $<VERSION_EQUAL:v1,v2> = '1' if v1 is the same version as v2, " \
"else '0'.\n" \
" $<C_COMPILER_VERSION> = The version of the C compiler used.\n" \
" $<C_COMPILER_VERSION:ver> = '1' if the version of the C " \
"compiler matches ver, otherwise '0'.\n" \
" $<CXX_COMPILER_VERSION> = The version of the CXX compiler " \
"used.\n" \
" $<CXX_COMPILER_VERSION:ver> = '1' if the version of the CXX " \
"compiler matches ver, otherwise '0'.\n" \
" $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n" \
" $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n" \
" $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)\n" \
"where \"tgt\" is the name of a target. " \
"Target file expressions produce a full path, but _DIR and _NAME " \
"versions can produce the directory and file name components:\n" \
" $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>\n" \
" $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>\n" \
" $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>\n" \
"\n" \
" $<TARGET_PROPERTY:tgt,prop> = The value of the property prop " \
"on the target tgt.\n" \
"Note that tgt is not added as a dependency of the target this " \
"expression is evaluated on.\n" \
" $<TARGET_POLICY:pol> = '1' if the policy was NEW when " \
"the 'head' target was created, else '0'. If the policy was not " \
"set, the warning message for the policy will be emitted. This " \
"generator expression only works for a subset of policies.\n" \
" $<INSTALL_PREFIX> = Content of the install prefix when " \
"the target is exported via INSTALL(EXPORT) and empty otherwise.\n" \
"Boolean expressions:\n" \
" $<AND:?[,?]...> = '1' if all '?' are '1', else '0'\n" \
" $<OR:?[,?]...> = '0' if all '?' are '0', else '1'\n" \
" $<NOT:?> = '0' if '?' is '1', else '1'\n" \
"where '?' is always either '0' or '1'.\n" \
""
#define CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS \
CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS \
"Expressions with an implicit 'this' target:\n" \
" $<TARGET_PROPERTY:prop> = The value of the property prop on " \
"the target on which the generator expression is evaluated.\n" \
""
#endif

View File

@@ -1,24 +0,0 @@
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2011 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.
============================================================================*/
#ifndef cmDocumentLocationUndefined_h
#define cmDocumentLocationUndefined_h
#define CM_LOCATION_UNDEFINED_BEHAVIOR(action) \
"\n" \
"Do not set properties that affect the location of a target after " \
action ". These include properties whose names match " \
"\"(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?\", " \
"\"(IMPLIB_)?(PREFIX|SUFFIX)\", or \"LINKER_LANGUAGE\". " \
"Failure to follow this rule is not diagnosed and leaves the location " \
"of the target undefined."
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +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.
============================================================================*/
#ifndef cmDocumentVariables_h
#define cmDocumentVariables_h
class cmake;
class cmDocumentVariables
{
public:
static void DefineVariables(cmake* cm);
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -15,11 +15,6 @@
#include "cmStandardIncludes.h"
#include "cmProperty.h"
#include "cmDocumentationFormatter.h"
#include "cmDocumentationFormatterHTML.h"
#include "cmDocumentationFormatterDocbook.h"
#include "cmDocumentationFormatterMan.h"
#include "cmDocumentationFormatterText.h"
#include "cmDocumentationFormatterUsage.h"
#include "cmDocumentationSection.h"
#include "cmake.h"
@@ -36,22 +31,6 @@ public:
~cmDocumentation();
/**
* An helper type pair for [structured] documented modules.
* The comment of those module contains structure markup
* which makes it possible to retrieve the documentation
* of variables, macros and functions defined in the module.
* - first is the filename of the module
* - second is the section of the doc the module belongs too
*/
typedef std::pair<std::string,std::string> documentedModuleSectionPair_t;
/**
* A list of documented module(s).
*/
typedef std::list<documentedModuleSectionPair_t> documentedModulesList_t;
// High-level interface for standard documents:
/**
* Check command line arguments for documentation options. Returns
* true if documentation options are found, and false otherwise.
@@ -72,7 +51,7 @@ public:
bool PrintRequestedDocumentation(std::ostream& os);
/** Print help of the given type. */
bool PrintDocumentation(Type ht, std::ostream& os, const char* docname=0);
bool PrintDocumentation(Type ht, std::ostream& os);
void SetShowGenerators(bool showGen) { this->ShowGenerators = showGen; }
@@ -80,62 +59,33 @@ public:
void SetName(const char* name);
/** Set a section of the documentation. Typical sections include Name,
Usage, Description, Options, SeeAlso */
Usage, Description, Options */
void SetSection(const char *sectionName,
cmDocumentationSection *section);
void SetSection(const char *sectionName,
std::vector<cmDocumentationEntry> &docs);
void SetSection(const char *sectionName,
const char *docs[][3]);
const char *docs[][2]);
void SetSections(std::map<std::string,cmDocumentationSection *>
&sections);
/** Add the documentation to the beginning/end of the section */
void PrependSection(const char *sectionName,
const char *docs[][3]);
const char *docs[][2]);
void PrependSection(const char *sectionName,
std::vector<cmDocumentationEntry> &docs);
void PrependSection(const char *sectionName,
cmDocumentationEntry &docs);
void AppendSection(const char *sectionName,
const char *docs[][3]);
const char *docs[][2]);
void AppendSection(const char *sectionName,
std::vector<cmDocumentationEntry> &docs);
void AppendSection(const char *sectionName,
cmDocumentationEntry &docs);
/**
* Print documentation in the given form. All previously added
* sections will be generated.
*/
void Print(Form f, int manSection, std::ostream& os);
/**
* Print documentation in the current form. All previously added
* sections will be generated.
*/
void Print(std::ostream& os);
/**
* Add a section of documentation. This can be used to generate custom help
* documents.
*/
void AddSectionToPrint(const char *section);
void SetSeeAlsoList(const char *data[][3]);
/** Clear all previously added sections of help. */
void ClearSections();
/** Set cmake root so we can find installed files */
void SetCMakeRoot(const char* root) { this->CMakeRoot = root;}
/** Set CMAKE_MODULE_PATH so we can find additional cmake modules */
void SetCMakeModulePath(const char* path) { this->CMakeModulePath = path;}
static Form GetFormFromFilename(const std::string& filename,
int* ManSection);
/** Add common (to all tools) documentation section(s) */
void addCommonStandardDocSections();
@@ -148,123 +98,50 @@ public:
/** Add the CPack standard documentation section(s) */
void addCPackStandardDocSections();
/** Add automatic variables sections */
void addAutomaticVariableSections(const std::string& section);
/**
* Retrieve the list of documented module located in
* path which match the globing expression globExpr.
* @param[in] path directory where to start the search
* we will recurse into it.
* @param[in] globExpr the globing expression used to
* match the file in path.
* @param[out] docModuleList the list of obtained pairs (may be empty)
* @return 0 on success 1 on error or empty list
*/
int getDocumentedModulesListInDir(
std::string path,
std::string globExpr,
documentedModulesList_t& docModuleList);
/**
* Get the documentation of macros, functions and variable documented
* with CMake structured documentation in a CMake script.
* (in fact it may be in any file which follow the structured doc format)
* Structured documentation begin with
* ## (double sharp) in column 1 & 2 immediately followed
* by a markup. Those ## are ignored by the legacy module
* documentation parser @see CreateSingleModule.
* Current markup are ##section, ##module,
* ##macro, ##function, ##variable and ##end.
* ##end is closing either of the previous ones.
* @param[in] fname the script file name to be parsed for documentation
* @param[in,out] commands the vector of command/macros documentation
* entry found in the script file.
* @param[in,out] cm the cmake object instance to which variable
* documentation will be attached
* (using @see cmake::DefineProperty)
* @return the number of documented items (command and variable)
* found in the file.
*/
int GetStructuredDocFromFile(const char* fname,
std::vector<cmDocumentationEntry>& commands,
cmake* cm);
private:
void SetForm(Form f, int manSection);
void SetDocName(const char* docname);
bool CreateSingleModule(const char* fname,
const char* moduleName,
cmDocumentationSection &sec);
void CreateModuleDocsForDir(cmsys::Directory& dir,
cmDocumentationSection &moduleSection);
bool CreateModulesSection();
bool CreateCustomModulesSection();
void CreateFullDocumentation();
void GlobHelp(std::vector<std::string>& files, std::string const& pattern);
void PrintNames(std::ostream& os, std::string const& pattern);
bool PrintFiles(std::ostream& os, std::string const& pattern);
void AddDocumentIntroToPrint(const char* intro[2]);
bool PrintCopyright(std::ostream& os);
bool PrintVersion(std::ostream& os);
bool PrintDocumentationGeneric(std::ostream& os, const char *section);
bool PrintDocumentationList(std::ostream& os, const char *section);
bool PrintDocumentationSingle(std::ostream& os);
bool PrintDocumentationSingleModule(std::ostream& os);
bool PrintDocumentationSingleProperty(std::ostream& os);
bool PrintDocumentationSinglePolicy(std::ostream& os);
bool PrintDocumentationSingleVariable(std::ostream& os);
bool PrintHelpOneManual(std::ostream& os);
bool PrintHelpOneCommand(std::ostream& os);
bool PrintHelpOneModule(std::ostream& os);
bool PrintHelpOnePolicy(std::ostream& os);
bool PrintHelpOneProperty(std::ostream& os);
bool PrintHelpOneVariable(std::ostream& os);
bool PrintHelpListManuals(std::ostream& os);
bool PrintHelpListCommands(std::ostream& os);
bool PrintHelpListModules(std::ostream& os);
bool PrintHelpListProperties(std::ostream& os);
bool PrintHelpListVariables(std::ostream& os);
bool PrintHelpListPolicies(std::ostream& os);
bool PrintDocumentationUsage(std::ostream& os);
bool PrintDocumentationFull(std::ostream& os);
bool PrintDocumentationModules(std::ostream& os);
bool PrintDocumentationCustomModules(std::ostream& os);
bool PrintDocumentationPolicies(std::ostream& os);
bool PrintDocumentationProperties(std::ostream& os);
bool PrintDocumentationVariables(std::ostream& os);
bool PrintDocumentationCurrentCommands(std::ostream& os);
bool PrintDocumentationCompatCommands(std::ostream& os);
void PrintDocumentationCommand(std::ostream& os,
const cmDocumentationEntry &entry);
const char* GetNameString() const;
const char* GetDocName(bool fallbackToNameString = true) const;
const char* GetDefaultDocName(Type ht) const;
bool IsOption(const char* arg) const;
bool ShowGenerators;
std::string NameString;
std::string DocName;
std::map<std::string,cmDocumentationSection*> AllSections;
std::string SeeAlsoString;
std::string CMakeRoot;
std::string CMakeModulePath;
std::set<std::string> ModulesFound;
std::vector< char* > ModuleStrings;
std::vector<const cmDocumentationSection *> PrintSections;
std::string CurrentArgument;
struct RequestedHelpItem
{
RequestedHelpItem():HelpForm(TextForm), HelpType(None), ManSection(1) {}
cmDocumentationEnums::Form HelpForm;
RequestedHelpItem(): HelpType(None) {}
cmDocumentationEnums::Type HelpType;
std::string Filename;
std::string Argument;
int ManSection;
};
std::vector<RequestedHelpItem> RequestedHelpItems;
cmDocumentationFormatter* CurrentFormatter;
cmDocumentationFormatterHTML HTMLFormatter;
cmDocumentationFormatterDocbook DocbookFormatter;
cmDocumentationFormatterMan ManFormatter;
cmDocumentationFormatterText TextFormatter;
cmDocumentationFormatterUsage UsageFormatter;
cmDocumentationFormatter Formatter;
std::vector<std::string> PropertySections;
std::vector<std::string> VariableSections;
static void WarnFormFromFilename(RequestedHelpItem& request);
};
#endif

View File

@@ -11,7 +11,10 @@
============================================================================*/
#include "cmDocumentationFormatter.h"
cmDocumentationFormatter::cmDocumentationFormatter()
#include "cmDocumentationSection.h"
cmDocumentationFormatter::cmDocumentationFormatter():
TextWidth(77), TextIndent("")
{
}
@@ -66,91 +69,162 @@ void cmDocumentationFormatter::PrintFormatted(std::ostream& os,
}
}
//----------------------------------------------------------------------------
std::string
cmDocumentationFormatter::ComputeSectionLinkPrefix(std::string const& name)
void cmDocumentationFormatter::PrintPreformatted(std::ostream& os,
const char* text)
{
// Map from section name to a prefix for links pointing within the
// section. For example, the commands section should have HTML
// links to each command with names like #command:ADD_EXECUTABLE.
if(name.find("Command") != name.npos)
bool newline = true;
for(const char* ptr = text; *ptr; ++ptr)
{
return "command";
}
else if(name.find("Propert") != name.npos)
{
if(name.find("Global") != name.npos)
if(newline && *ptr != '\n')
{
return "prop_global";
os << this->TextIndent;
newline = false;
}
else if(name.find("Direct") != name.npos)
os << *ptr;
if(*ptr == '\n')
{
return "prop_dir";
newline = true;
}
else if(name.find("Target") != name.npos)
}
os << "\n";
}
void cmDocumentationFormatter::PrintParagraph(std::ostream& os,
const char* text)
{
os << this->TextIndent;
this->PrintColumn(os, text);
os << "\n";
}
void cmDocumentationFormatter::SetIndent(const char* indent)
{
this->TextIndent = indent;
}
void cmDocumentationFormatter::PrintColumn(std::ostream& os,
const char* text)
{
// Print text arranged in an indented column of fixed witdh.
const char* l = text;
long column = 0;
bool newSentence = false;
bool firstLine = true;
int width = this->TextWidth - static_cast<int>(strlen(this->TextIndent));
// Loop until the end of the text.
while(*l)
{
// Parse the next word.
const char* r = l;
while(*r && (*r != '\n') && (*r != ' ')) { ++r; }
// Does it fit on this line?
if(r-l < (width-column-(newSentence?1:0)))
{
return "prop_tgt";
// Word fits on this line.
if(r > l)
{
if(column)
{
// Not first word on line. Separate from the previous word
// by a space, or two if this is a new sentence.
if(newSentence)
{
os << " ";
column += 2;
}
else
{
os << " ";
column += 1;
}
}
else
{
// First word on line. Print indentation unless this is the
// first line.
os << (firstLine?"":this->TextIndent);
}
// Print the word.
os.write(l, static_cast<long>(r-l));
newSentence = (*(r-1) == '.');
}
if(*r == '\n')
{
// Text provided a newline. Start a new line.
os << "\n";
++r;
column = 0;
firstLine = false;
}
else
{
// No provided newline. Continue this line.
column += static_cast<long>(r-l);
}
}
else if(name.find("Test") != name.npos)
else
{
return "prop_test";
// Word does not fit on this line. Start a new line.
os << "\n";
firstLine = false;
if(r > l)
{
os << this->TextIndent;
os.write(l, static_cast<long>(r-l));
column = static_cast<long>(r-l);
newSentence = (*(r-1) == '.');
}
else
{
column = 0;
}
}
else if(name.find("Source") != name.npos)
{
return "prop_sf";
}
return "property";
}
else if(name.find("Variable") != name.npos)
{
return "variable";
}
else if(name.find("Polic") != name.npos)
{
return "policy";
}
else if(name.find("Module") != name.npos)
{
return "module";
}
else if(name.find("Name") != name.npos ||
name.find("Introduction") != name.npos)
{
return "name";
}
else if(name.find("Usage") != name.npos)
{
return "usage";
}
else if(name.find("Description") != name.npos)
{
return "desc";
}
else if(name.find("Generators") != name.npos)
{
return "gen";
}
else if(name.find("Options") != name.npos)
{
return "opt";
}
else if(name.find("Copyright") != name.npos)
{
return "copy";
}
else if(name.find("See Also") != name.npos)
{
return "see";
}
else if(name.find("SingleItem") != name.npos)
{
return "single_item";
}
else
{
std::cerr
<< "WARNING: ComputeSectionLinkPrefix failed for \"" << name << "\""
<< std::endl;
return "other";
// Move to beginning of next word. Skip over whitespace.
l = r;
while(*l && (*l == ' ')) { ++l; }
}
}
void cmDocumentationFormatter
::PrintSection(std::ostream& os,
cmDocumentationSection const& section)
{
os << section.GetName() << "\n";
const std::vector<cmDocumentationEntry> &entries =
section.GetEntries();
for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end(); ++op)
{
if(op->Name.size())
{
os << " " << op->Name;
this->TextIndent = " ";
int align = static_cast<int>(strlen(this->TextIndent))-4;
for(int i = static_cast<int>(op->Name.size()); i < align; ++i)
{
os << " ";
}
if (op->Name.size() > strlen(this->TextIndent)-4 )
{
os << "\n";
os.write(this->TextIndent, strlen(this->TextIndent)-2);
}
os << "= ";
this->PrintColumn(os, op->Brief.c_str());
os << "\n";
}
else
{
os << "\n";
this->TextIndent = "";
this->PrintFormatted(os, op->Brief.c_str());
}
}
os << "\n";
}

View File

@@ -25,19 +25,16 @@ class cmDocumentationEnums
public:
/** Types of help provided. */
enum Type
{ None, Usage, Single, SingleModule, SingleProperty, SingleVariable,
List, ModuleList, PropertyList, VariableList,
Full, Properties, Variables, Modules, CustomModules, Commands,
CompatCommands, Copyright, Version, Policies, SinglePolicy };
/** Forms of documentation output. */
enum Form { TextForm, HTMLForm, ManForm, UsageForm, DocbookForm };
{
None, Version, Usage, ListManuals,
ListCommands, ListModules, ListProperties, ListVariables, ListPolicies,
OneManual, OneCommand, OneModule, OneProperty, OneVariable, OnePolicy
};
};
class cmDocumentationSection;
/** Base class for printing the documentation in the various supported
formats. */
/** Print documentation in a simple text format. */
class cmDocumentationFormatter
{
public:
@@ -45,23 +42,15 @@ public:
virtual ~cmDocumentationFormatter();
void PrintFormatted(std::ostream& os, const char* text);
virtual cmDocumentationEnums::Form GetForm() const = 0;
virtual void PrintHeader(const char* /*docname*/,
const char* /*appname*/,
std::ostream& /*os*/) {}
virtual void PrintFooter(std::ostream& /*os*/) {}
virtual void PrintSection(std::ostream& os,
const cmDocumentationSection& section,
const char* name) = 0;
virtual void PrintPreformatted(std::ostream& os, const char* text) = 0;
virtual void PrintParagraph(std::ostream& os, const char* text) = 0;
virtual void PrintIndex(std::ostream& ,
std::vector<const cmDocumentationSection *>&)
{}
/** Compute a prefix for links into a section (#\<prefix\>_SOMETHING). */
std::string ComputeSectionLinkPrefix(std::string const& name);
cmDocumentationSection const& section);
virtual void PrintPreformatted(std::ostream& os, const char* text);
virtual void PrintParagraph(std::ostream& os, const char* text);
void PrintColumn(std::ostream& os, const char* text);
void SetIndent(const char* indent);
private:
int TextWidth;
const char* TextIndent;
};
#endif

View File

@@ -1,254 +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.
============================================================================*/
#include "cmDocumentationFormatterDocbook.h"
#include "cmDocumentationSection.h"
#include <algorithm>
#include <ctype.h> // for isalnum
static int cmIsAlnum(int c)
{
return isalnum(c);
}
//----------------------------------------------------------------------------
// this function is a copy of the one in the HTML formatter
// the three functions below are slightly modified copies
static bool cmDocumentationIsHyperlinkCharDocbook(char c)
{
// This is not a complete list but works for CMake documentation.
return ((c >= 'A' && c <= 'Z') ||
(c >= 'a' && c <= 'z') ||
(c >= '0' && c <= '9') ||
c == '-' || c == '.' || c == '/' || c == '~' || c == '@' ||
c == ':' || c == '_' || c == '&' || c == '?' || c == '=');
}
//----------------------------------------------------------------------------
static void cmDocumentationPrintDocbookChar(std::ostream& os, char c)
{
// Use an escape sequence if necessary.
switch(c)
{
case '<':
os << "&lt;";
break;
case '>':
os << "&gt;";
break;
case '&':
os << "&amp;";
break;
default:
os << c;
}
}
//----------------------------------------------------------------------------
const char* cmDocumentationPrintDocbookLink(std::ostream& os,const char* begin)
{
// Look for the end of the link.
const char* end = begin;
while(cmDocumentationIsHyperlinkCharDocbook(*end))
{
++end;
}
// Print the hyperlink itself.
os << "<ulink url=\"";
for(const char* c = begin; c != end; ++c)
{
cmDocumentationPrintDocbookChar(os, *c);
}
os << "\" />";
return end;
}
//----------------------------------------------------------------------------
void cmDocumentationPrintDocbookEscapes(std::ostream& os, const char* text)
{
// Hyperlink prefixes.
static const char* hyperlinks[] = {"http://", "ftp://", "mailto:", 0};
// Print each character.
for(const char* p = text; *p;)
{
// Handle hyperlinks specially to make them active.
bool found_hyperlink = false;
for(const char** h = hyperlinks; !found_hyperlink && *h; ++h)
{
if(strncmp(p, *h, strlen(*h)) == 0)
{
p = cmDocumentationPrintDocbookLink(os, p);
found_hyperlink = true;
}
}
// Print other characters normally.
if(!found_hyperlink)
{
cmDocumentationPrintDocbookChar(os, *p++);
}
}
}
//----------------------------------------------------------------------------
cmDocumentationFormatterDocbook::cmDocumentationFormatterDocbook()
:cmDocumentationFormatter()
{
}
//----------------------------------------------------------------------------
void cmDocumentationFormatterDocbook
::PrintSection(std::ostream& os,
const cmDocumentationSection &section,
const char* name)
{
os << "<sect1 id=\"";
this->PrintId(os, 0, name);
os << "\">\n<title>" << name << "</title>\n";
std::string prefix = this->ComputeSectionLinkPrefix(name);
const std::vector<cmDocumentationEntry> &entries = section.GetEntries();
bool hasSubSections = false;
for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end(); ++op)
{
if(op->Name.size())
{
hasSubSections = true;
break;
}
}
bool inAbstract = false;
for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end(); ++op)
{
if(op->Name.size())
{
if(inAbstract)
{
os << "</abstract>\n";
inAbstract = false;
}
os << "<sect2 id=\"";
this->PrintId(os, prefix.c_str(), op->Name);
os << "\">\n<title>";
cmDocumentationPrintDocbookEscapes(os, op->Name.c_str());
os << "</title>\n";
if(op->Full.size())
{
os << "<abstract>\n<para>";
cmDocumentationPrintDocbookEscapes(os, op->Brief.c_str());
os << "</para>\n</abstract>\n";
this->PrintFormatted(os, op->Full.c_str());
}
else
{
this->PrintFormatted(os, op->Brief.c_str());
}
os << "</sect2>\n";
}
else
{
if(hasSubSections && op == entries.begin())
{
os << "<abstract>\n";
inAbstract = true;
}
this->PrintFormatted(os, op->Brief.c_str());
}
}
// empty sections are not allowed in docbook.
if(entries.empty())
{
os << "<para/>\n";
}
os << "</sect1>\n";
}
//----------------------------------------------------------------------------
void cmDocumentationFormatterDocbook
::PrintPreformatted(std::ostream& os, const char* text)
{
os << "<para>\n<programlisting>";
cmDocumentationPrintDocbookEscapes(os, text);
os << "</programlisting>\n</para>\n";
}
void cmDocumentationFormatterDocbook
::PrintParagraph(std::ostream& os, const char* text)
{
os << "<para>";
cmDocumentationPrintDocbookEscapes(os, text);
os << "</para>\n";
}
//----------------------------------------------------------------------------
void cmDocumentationFormatterDocbook
::PrintHeader(const char* docname, const char* appname, std::ostream& os)
{
this->Docname = docname;
// this one is used to ensure that we don't create multiple link targets
// with the same name. We can clear it here since we are at the
// start of a document here.
this->EmittedLinkIds.clear();
os << "<?xml version=\"1.0\" ?>\n"
"<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook V4.5//EN\" "
"\"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\" [\n"
"<!ENTITY % addindex \"IGNORE\">\n"
"<!ENTITY % English \"INCLUDE\"> ]>\n"
"<article>\n"
"<articleinfo>\n"
"<title>" << docname << " - " << appname << "</title>\n"
"</articleinfo>\n";
}
//----------------------------------------------------------------------------
void cmDocumentationFormatterDocbook::PrintFooter(std::ostream& os)
{
os << "</article>\n";
}
//----------------------------------------------------------------------------
void cmDocumentationFormatterDocbook
::PrintId(std::ostream& os, const char* prefix, std::string id)
{
std::replace_if(id.begin(), id.end(),
std::not1(std::ptr_fun(cmIsAlnum)), '_');
if(prefix)
{
id = std::string(prefix) + "." + id;
}
os << this->Docname << '.' << id;
// make sure that each id exists only once. Since it seems
// not easily possible to determine which link refers to which id,
// we have at least to make sure that the duplicated id's get a
// different name (by appending an increasing number), Alex
if (this->EmittedLinkIds.find(id) == this->EmittedLinkIds.end())
{
this->EmittedLinkIds.insert(id);
}
else
{
static unsigned int i=0;
os << i++;
}
}

View File

@@ -1,43 +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.
============================================================================*/
#ifndef _cmDocumentationFormatterDocbook_h
#define _cmDocumentationFormatterDocbook_h
#include "cmStandardIncludes.h"
#include "cmDocumentationFormatter.h"
/** Class to print the documentation as Docbook.
http://www.oasis-open.org/docbook/xml/4.2/ */
class cmDocumentationFormatterDocbook : public cmDocumentationFormatter
{
public:
cmDocumentationFormatterDocbook();
virtual cmDocumentationEnums::Form GetForm() const
{ return cmDocumentationEnums::DocbookForm;}
virtual void PrintHeader(const char* docname, const char* appname,
std::ostream& os);
virtual void PrintFooter(std::ostream& os);
virtual void PrintSection(std::ostream& os,
const cmDocumentationSection& section,
const char* name);
virtual void PrintPreformatted(std::ostream& os, const char* text);
virtual void PrintParagraph(std::ostream& os, const char* text);
private:
void PrintId(std::ostream& os, const char* prefix, std::string id);
std::set<std::string> EmittedLinkIds;
std::string Docname;
};
#endif

View File

@@ -1,288 +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.
============================================================================*/
#include "cmDocumentationFormatterHTML.h"
#include "cmDocumentationSection.h"
#include "cmVersion.h"
//----------------------------------------------------------------------------
static bool cmDocumentationIsHyperlinkChar(char c)
{
// This is not a complete list but works for CMake documentation.
return ((c >= 'A' && c <= 'Z') ||
(c >= 'a' && c <= 'z') ||
(c >= '0' && c <= '9') ||
c == '-' || c == '.' || c == '/' || c == '~' || c == '@' ||
c == ':' || c == '_' || c == '&' || c == '?' || c == '=');
}
//----------------------------------------------------------------------------
static void cmDocumentationPrintHTMLChar(std::ostream& os, char c)
{
// Use an escape sequence if necessary.
switch (c)
{
case '<':
os << "&lt;";
break;
case '>':
os << "&gt;";
break;
case '&':
os << "&amp;";
break;
case '\n':
os << "<br />";
break;
default:
os << c;
}
}
//----------------------------------------------------------------------------
bool cmDocumentationHTMLIsIdChar(char c)
{
// From the HTML specification:
// ID and NAME tokens must begin with a letter ([A-Za-z]) and may
// be followed by any number of letters, digits ([0-9]), hyphens
// ("-"), underscores ("_"), colons (":"), and periods (".").
return ((c >= 'A' && c <= 'Z') ||
(c >= 'a' && c <= 'z') ||
(c >= '0' && c <= '9') ||
c == '-' || c == '_' || c == ':' || c == '.');
}
//----------------------------------------------------------------------------
void cmDocumentationPrintHTMLId(std::ostream& os, const char* begin)
{
for(const char* c = begin; *c; ++c)
{
if(cmDocumentationHTMLIsIdChar(*c))
{
os << *c;
}
}
}
//----------------------------------------------------------------------------
const char* cmDocumentationPrintHTMLLink(std::ostream& os, const char* begin)
{
// Look for the end of the link.
const char* end = begin;
while(cmDocumentationIsHyperlinkChar(*end))
{
++end;
}
// Print the hyperlink itself.
os << "<a href=\"";
for(const char* c = begin; c != end; ++c)
{
cmDocumentationPrintHTMLChar(os, *c);
}
os << "\">";
// The name of the hyperlink is the text itself.
for(const char* c = begin; c != end; ++c)
{
cmDocumentationPrintHTMLChar(os, *c);
}
os << "</a>";
// Return the position at which to continue scanning the input
// string.
return end;
}
cmDocumentationFormatterHTML::cmDocumentationFormatterHTML()
:cmDocumentationFormatter()
{
}
void cmDocumentationFormatterHTML
::PrintSection(std::ostream& os,
const cmDocumentationSection &section,
const char* name)
{
std::string prefix = this->ComputeSectionLinkPrefix(name);
const std::vector<cmDocumentationEntry> &entries =
section.GetEntries();
// skip the index if the help for only a single item (--help-command,
// --help-policy, --help-property, --help-module) is printed
bool isSingleItemHelp = ((name!=0) && (strcmp(name, "SingleItem")==0));
if (!isSingleItemHelp)
{
if (name)
{
os << "<h2><a name=\"section_";
cmDocumentationPrintHTMLId(os, name);
os << "\"></a>" << name << "</h2>\n";
}
// Is a list needed?
for(std::vector<cmDocumentationEntry>::const_iterator op
= entries.begin(); op != entries.end(); ++ op )
{
if (op->Name.size())
{
os << "<ul>\n";
for(;op != entries.end() && op->Name.size(); ++op)
{
if(op->Name.size())
{
os << " <li><a href=\"#" << prefix << ":";
cmDocumentationPrintHTMLId(os, op->Name.c_str());
os << "\"><b><code>";
this->PrintHTMLEscapes(os, op->Name.c_str());
os << "</code></b></a></li>\n";
}
}
os << "</ul>\n" ;
break; // Skip outer loop termination test
}
}
}
for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end();)
{
if(op->Name.size())
{
os << "<ul>\n";
for(;op != entries.end() && op->Name.size(); ++op)
{
os << " <li>\n";
if(op->Name.size())
{
os << " <a name=\"" << prefix << ":";
cmDocumentationPrintHTMLId(os, op->Name.c_str());
os << "\"></a><b><code>";
this->PrintHTMLEscapes(os, op->Name.c_str());
os << "</code></b>: ";
}
this->PrintHTMLEscapes(os, op->Brief.c_str());
if(op->Full.size())
{
os << "<br />\n ";
this->PrintFormatted(os, op->Full.c_str());
}
os << "\n";
os << " </li>\n";
}
os << "</ul>\n";
}
else
{
this->PrintFormatted(os, op->Brief.c_str());
os << "\n";
++op;
}
}
}
void cmDocumentationFormatterHTML::PrintPreformatted(std::ostream& os,
const char* text)
{
os << "<pre>";
this->PrintHTMLEscapes(os, text);
os << "</pre>\n ";
}
void cmDocumentationFormatterHTML::PrintParagraph(std::ostream& os,
const char* text)
{
os << "<p>";
this->PrintHTMLEscapes(os, text);
os << "</p>\n";
}
//----------------------------------------------------------------------------
void cmDocumentationFormatterHTML::PrintHeader(const char* docname,
const char* appname,
std::ostream& os)
{
os << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
<< " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
os << "<html xmlns=\"http://www.w3.org/1999/xhtml\""
<< " xml:lang=\"en\" lang=\"en\">\n";
os << "<head><meta http-equiv=\"Content-Type\" "
<< "content=\"text/html;charset=utf-8\" /><title>";
os << docname << " - " << appname;
os << "</title></head><body>\n";
}
//----------------------------------------------------------------------------
void cmDocumentationFormatterHTML::PrintFooter(std::ostream& os)
{
os << "</body></html>\n";
}
//----------------------------------------------------------------------------
void cmDocumentationFormatterHTML::PrintHTMLEscapes(std::ostream& os,
const char* text)
{
// Hyperlink prefixes.
static const char* hyperlinks[] = {"http://", "ftp://", "mailto:", 0};
// Print each character.
for(const char* p = text; *p;)
{
// Handle hyperlinks specially to make them active.
bool found_hyperlink = false;
for(const char** h = hyperlinks; !found_hyperlink && *h; ++h)
{
if(strncmp(p, *h, strlen(*h)) == 0)
{
p = cmDocumentationPrintHTMLLink(os, p);
found_hyperlink = true;
}
}
// Print other characters normally.
if(!found_hyperlink)
{
cmDocumentationPrintHTMLChar(os, *p++);
}
}
}
void cmDocumentationFormatterHTML
::PrintIndex(std::ostream& os,
std::vector<const cmDocumentationSection *>& sections)
{
// skip the index if only the help for a single item is printed
if ((sections.size() == 1)
&& (sections[0]->GetName(this->GetForm()) != 0 )
&& (std::string(sections[0]->GetName(this->GetForm())) == "SingleItem"))
{
return;
}
os << "<h2><a name=\"section_Index\"></a>Master Index "
<< "CMake " << cmVersion::GetCMakeVersion()
<< "</h2>\n";
if (!sections.empty())
{
os << "<ul>\n";
for(unsigned int i=0; i < sections.size(); ++i)
{
std::string name = sections[i]->GetName((this->GetForm()));
os << " <li><a href=\"#section_";
cmDocumentationPrintHTMLId(os, name.c_str());
os << "\"><b>" << name << "</b></a></li>\n";
}
os << "</ul>\n";
}
}

View File

@@ -1,42 +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.
============================================================================*/
#ifndef _cmDocumentationFormatterHTML_h
#define _cmDocumentationFormatterHTML_h
#include "cmStandardIncludes.h"
#include "cmDocumentationFormatter.h"
/** Class to print the documentation as HTML. */
class cmDocumentationFormatterHTML : public cmDocumentationFormatter
{
public:
cmDocumentationFormatterHTML();
virtual cmDocumentationEnums::Form GetForm() const
{ return cmDocumentationEnums::HTMLForm;}
virtual void PrintHeader(const char* docname, const char* appname,
std::ostream& os);
virtual void PrintFooter(std::ostream& os);
virtual void PrintSection(std::ostream& os,
const cmDocumentationSection& section,
const char* name);
virtual void PrintPreformatted(std::ostream& os, const char* text);
virtual void PrintParagraph(std::ostream& os, const char* text);
virtual void PrintIndex(std::ostream& ,
std::vector<const cmDocumentationSection *>&);
private:
void PrintHTMLEscapes(std::ostream& os, const char* text);
};
#endif

View File

@@ -1,102 +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.
============================================================================*/
#include "cmDocumentationFormatterMan.h"
#include "cmDocumentationSection.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
cmDocumentationFormatterMan::cmDocumentationFormatterMan()
:cmDocumentationFormatter()
,ManSection(1)
{
}
void cmDocumentationFormatterMan::SetManSection(int manSection)
{
this->ManSection = manSection;
}
void cmDocumentationFormatterMan
::PrintSection(std::ostream& os,
const cmDocumentationSection &section,
const char* name)
{
if(name)
{
os << ".SH " << name << "\n";
}
const std::vector<cmDocumentationEntry> &entries =
section.GetEntries();
for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end(); ++op)
{
if(op->Name.size())
{
os << ".TP\n"
<< ".B " << (op->Name.size()?op->Name.c_str():"*") << "\n";
this->PrintFormatted(os, op->Brief.c_str());
this->PrintFormatted(os, op->Full.c_str());
}
else
{
os << ".PP\n";
this->PrintFormatted(os, op->Brief.c_str());
}
}
}
void cmDocumentationFormatterMan::EscapeText(std::string& man_text)
{
cmSystemTools::ReplaceString(man_text, "\\", "\\\\");
cmSystemTools::ReplaceString(man_text, "-", "\\-");
}
void cmDocumentationFormatterMan::PrintPreformatted(std::ostream& os,
const char* text)
{
std::string man_text = text;
this->EscapeText(man_text);
os << ".nf\n" << man_text;
if (*text && man_text.at(man_text.length()-1) != '\n')
os << "\n";
os << ".fi\n\n";
}
void cmDocumentationFormatterMan::PrintParagraph(std::ostream& os,
const char* text)
{
std::string man_text = text;
this->EscapeText(man_text);
os << man_text << "\n\n";
}
//----------------------------------------------------------------------------
void cmDocumentationFormatterMan::PrintHeader(const char* docname,
const char* appname,
std::ostream& os)
{
std::string s_docname(docname), s_appname(appname);
this->EscapeText(s_docname);
this->EscapeText(s_appname);
os << ".TH " << s_docname << " " << this->ManSection << " \""
<< cmSystemTools::GetCurrentDateTime("%B %d, %Y").c_str()
<< "\" \"" << s_appname
<< " " << cmVersion::GetCMakeVersion()
<< "\"\n";
}

View File

@@ -1,43 +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.
============================================================================*/
#ifndef _cmDocumentationFormatterMan_h
#define _cmDocumentationFormatterMan_h
#include "cmStandardIncludes.h"
#include "cmDocumentationFormatter.h"
/** Class to print the documentation as man page. */
class cmDocumentationFormatterMan : public cmDocumentationFormatter
{
public:
cmDocumentationFormatterMan();
void SetManSection(int manSection);
virtual cmDocumentationEnums::Form GetForm() const
{ return cmDocumentationEnums::ManForm;}
virtual void PrintHeader(const char* docname, const char* appname,
std::ostream& os);
virtual void PrintSection(std::ostream& os,
const cmDocumentationSection& section,
const char* name);
virtual void PrintPreformatted(std::ostream& os, const char* text);
virtual void PrintParagraph(std::ostream& os, const char* text);
private:
void EscapeText(std::string& man_text);
int ManSection;
};
#endif

View File

@@ -1,180 +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.
============================================================================*/
#include "cmDocumentationFormatterText.h"
#include "cmDocumentationSection.h"
cmDocumentationFormatterText::cmDocumentationFormatterText()
:cmDocumentationFormatter()
,TextWidth(77)
,TextIndent("")
{
}
void cmDocumentationFormatterText
::PrintSection(std::ostream& os,
const cmDocumentationSection &section,
const char* name)
{
if(name && (strcmp(name, "SingleItem")!=0))
{
os <<
"---------------------------------------"
"---------------------------------------\n";
os << name << "\n\n";
}
const std::vector<cmDocumentationEntry> &entries =
section.GetEntries();
for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end(); ++op)
{
if(op->Name.size())
{
os << " " << op->Name << "\n";
this->TextIndent = " ";
this->PrintFormatted(os, op->Brief.c_str());
if(op->Full.size())
{
os << "\n";
this->PrintFormatted(os, op->Full.c_str());
}
}
else
{
this->TextIndent = "";
this->PrintFormatted(os, op->Brief.c_str());
}
os << "\n";
}
}
void cmDocumentationFormatterText::PrintPreformatted(std::ostream& os,
const char* text)
{
bool newline = true;
for(const char* ptr = text; *ptr; ++ptr)
{
if(newline && *ptr != '\n')
{
os << this->TextIndent;
newline = false;
}
os << *ptr;
if(*ptr == '\n')
{
newline = true;
}
}
os << "\n";
}
void cmDocumentationFormatterText::PrintParagraph(std::ostream& os,
const char* text)
{
os << this->TextIndent;
this->PrintColumn(os, text);
os << "\n";
}
void cmDocumentationFormatterText::SetIndent(const char* indent)
{
this->TextIndent = indent;
}
void cmDocumentationFormatterText::PrintColumn(std::ostream& os,
const char* text)
{
// Print text arranged in an indented column of fixed witdh.
const char* l = text;
long column = 0;
bool newSentence = false;
bool firstLine = true;
int width = this->TextWidth - static_cast<int>(strlen(this->TextIndent));
// Loop until the end of the text.
while(*l)
{
// Parse the next word.
const char* r = l;
while(*r && (*r != '\n') && (*r != ' ')) { ++r; }
// Does it fit on this line?
if(r-l < (width-column-(newSentence?1:0)))
{
// Word fits on this line.
if(r > l)
{
if(column)
{
// Not first word on line. Separate from the previous word
// by a space, or two if this is a new sentence.
if(newSentence)
{
os << " ";
column += 2;
}
else
{
os << " ";
column += 1;
}
}
else
{
// First word on line. Print indentation unless this is the
// first line.
os << (firstLine?"":this->TextIndent);
}
// Print the word.
os.write(l, static_cast<long>(r-l));
newSentence = (*(r-1) == '.');
}
if(*r == '\n')
{
// Text provided a newline. Start a new line.
os << "\n";
++r;
column = 0;
firstLine = false;
}
else
{
// No provided newline. Continue this line.
column += static_cast<long>(r-l);
}
}
else
{
// Word does not fit on this line. Start a new line.
os << "\n";
firstLine = false;
if(r > l)
{
os << this->TextIndent;
os.write(l, static_cast<long>(r-l));
column = static_cast<long>(r-l);
newSentence = (*(r-1) == '.');
}
else
{
column = 0;
}
}
// Move to beginning of next word. Skip over whitespace.
l = r;
while(*l && (*l == ' ')) { ++l; }
}
}

View File

@@ -1,40 +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.
============================================================================*/
#ifndef _cmDocumentationFormatterText_h
#define _cmDocumentationFormatterText_h
#include "cmStandardIncludes.h"
#include "cmDocumentationFormatter.h"
/** Class to print the documentation as plain text. */
class cmDocumentationFormatterText : public cmDocumentationFormatter
{
public:
cmDocumentationFormatterText();
virtual cmDocumentationEnums::Form GetForm() const
{ return cmDocumentationEnums::TextForm;}
virtual void PrintSection(std::ostream& os,
const cmDocumentationSection& section,
const char* name);
virtual void PrintPreformatted(std::ostream& os, const char* text);
virtual void PrintParagraph(std::ostream& os, const char* text);
void PrintColumn(std::ostream& os, const char* text);
void SetIndent(const char* indent);
protected:
int TextWidth;
const char* TextIndent;
};
#endif

View File

@@ -1,63 +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.
============================================================================*/
#include "cmDocumentationFormatterUsage.h"
#include "cmDocumentationSection.h"
cmDocumentationFormatterUsage::cmDocumentationFormatterUsage()
:cmDocumentationFormatterText()
{
}
void cmDocumentationFormatterUsage
::PrintSection(std::ostream& os,
const cmDocumentationSection &section,
const char* name)
{
if(name)
{
os << name << "\n";
}
const std::vector<cmDocumentationEntry> &entries =
section.GetEntries();
for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end(); ++op)
{
if(op->Name.size())
{
os << " " << op->Name;
this->TextIndent = " ";
int align = static_cast<int>(strlen(this->TextIndent))-4;
for(int i = static_cast<int>(op->Name.size()); i < align; ++i)
{
os << " ";
}
if (op->Name.size() > strlen(this->TextIndent)-4 )
{
os << "\n";
os.write(this->TextIndent, strlen(this->TextIndent)-2);
}
os << "= ";
this->PrintColumn(os, op->Brief.c_str());
os << "\n";
}
else
{
os << "\n";
this->TextIndent = "";
this->PrintFormatted(os, op->Brief.c_str());
}
}
os << "\n";
}

View File

@@ -1,31 +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.
============================================================================*/
#ifndef _cmDocumentationFormatterUsage_h
#define _cmDocumentationFormatterUsage_h
#include "cmDocumentationFormatterText.h"
/** Class to print the documentation as usage on the command line. */
class cmDocumentationFormatterUsage : public cmDocumentationFormatterText
{
public:
cmDocumentationFormatterUsage();
virtual cmDocumentationEnums::Form GetForm() const
{ return cmDocumentationEnums::UsageForm;}
virtual void PrintSection(std::ostream& os,
const cmDocumentationSection& section,
const char* name);
};
#endif

View File

@@ -13,69 +13,33 @@
//----------------------------------------------------------------------------
void cmDocumentationSection::Append(const char *data[][3])
void cmDocumentationSection::Append(const char *data[][2])
{
int i = 0;
while(data[i][1])
{
this->Entries.push_back(cmDocumentationEntry(data[i][0],
data[i][1],
data[i][2]));
data[i][1]));
data += 1;
}
}
//----------------------------------------------------------------------------
void cmDocumentationSection::Prepend(const char *data[][3])
void cmDocumentationSection::Prepend(const char *data[][2])
{
std::vector<cmDocumentationEntry> tmp;
int i = 0;
while(data[i][1])
{
tmp.push_back(cmDocumentationEntry(data[i][0],
data[i][1],
data[i][2]));
data[i][1]));
data += 1;
}
this->Entries.insert(this->Entries.begin(),tmp.begin(),tmp.end());
}
//----------------------------------------------------------------------------
void cmDocumentationSection::Append(const char *n, const char *b,
const char *f)
void cmDocumentationSection::Append(const char *n, const char *b)
{
this->Entries.push_back(cmDocumentationEntry(n,b,f));
this->Entries.push_back(cmDocumentationEntry(n,b));
}
#if 0
//----------------------------------------------------------------------------
void cmDocumentationSection::Set(const cmDocumentationEntry* header,
const cmDocumentationEntry* section,
const cmDocumentationEntry* footer)
{
this->Entries.erase(this->Entries.begin(), this->Entries.end());
if(header)
{
for(const cmDocumentationEntry* op = header; op->brief; ++op)
{
this->Entries.push_back(*op);
}
}
if(section)
{
for(const cmDocumentationEntry* op = section; op->brief; ++op)
{
this->Entries.push_back(*op);
}
}
if(footer)
{
for(const cmDocumentationEntry* op = footer; op->brief; ++op)
{
this->Entries.push_back(*op);
}
}
cmDocumentationEntry empty = {0,0,0};
this->Entries.push_back(empty);
}
#endif

View File

@@ -24,8 +24,8 @@ class cmDocumentationSection
{
public:
/** Create a cmSection, with a special name for man-output mode. */
cmDocumentationSection(const char* name, const char* manName)
:Name(name), ManName(manName) {}
cmDocumentationSection(const char* name, const char*)
:Name(name) {}
/** Has any content been added to this section or is it empty ? */
bool IsEmpty() const { return this->Entries.empty(); }
@@ -33,10 +33,9 @@ public:
/** Clear contents. */
void Clear() { this->Entries.clear(); }
/** Return the name of this section for the given output form. */
const char* GetName(cmDocumentationEnums::Form form) const
{ return (form==cmDocumentationEnums::ManForm ?
this->ManName.c_str() : this->Name.c_str()); }
/** Return the name of this section. */
const char* GetName() const
{ return this->Name.c_str(); }
/** Return a pointer to the first entry of this section. */
const std::vector<cmDocumentationEntry> &GetEntries() const
@@ -49,11 +48,11 @@ public:
{ this->Entries.insert(this->Entries.end(),entries.begin(),entries.end()); }
/** Append an entry to this section using NULL terminated chars */
void Append(const char *[][3]);
void Append(const char *n, const char *b, const char *f);
void Append(const char *[][2]);
void Append(const char *n, const char *b);
/** prepend some documentation to this section */
void Prepend(const char *[][3]);
void Prepend(const char *[][2]);
void Prepend(const std::vector<cmDocumentationEntry> &entries)
{ this->Entries.insert(this->Entries.begin(),
entries.begin(),entries.end()); }
@@ -61,7 +60,6 @@ public:
private:
std::string Name;
std::string ManName;
std::vector<cmDocumentationEntry> Entries;
};

View File

@@ -47,24 +47,6 @@ public:
*/
virtual const char* GetName() const { return "else";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Starts the else portion of an if block.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" else(expression)\n"
"See the if command.";
}
cmTypeMacro(cmElseCommand, cmCommand);
};

View File

@@ -47,24 +47,6 @@ public:
*/
virtual const char* GetName() const { return "elseif";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Starts the elseif portion of an if block.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" elseif(expression)\n"
"See the if command.";
}
cmTypeMacro(cmElseIfCommand, cmCommand);
};

View File

@@ -45,37 +45,6 @@ public:
*/
virtual const char* GetName() const {return "enable_language";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Enable a language (CXX/C/Fortran/etc)";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" enable_language(<lang> [OPTIONAL] )\n"
"This command enables support for the named language in CMake. "
"This is the same as the project command but does not create "
"any of the extra variables that are created by the project command. "
"Example languages are CXX, C, Fortran. "
"\n"
"This command must be called in file scope, not in a function call. "
"Furthermore, it must be called in the highest directory common to "
"all targets using the named language directly for compiling sources "
"or indirectly through link dependencies. "
"It is simplest to enable all needed languages in the top-level "
"directory of a project."
"\n"
"The OPTIONAL keyword is a placeholder for future implementation "
"and does not currently work.";
}
cmTypeMacro(cmEnableLanguageCommand, cmCommand);
};

View File

@@ -50,27 +50,6 @@ public:
*/
virtual const char* GetName() const { return "enable_testing";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Enable testing for current directory and below.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" enable_testing()\n"
"Enables testing for this directory and below. "
"See also the add_test command. Note that ctest expects to find "
"a test file in the build directory root. Therefore, this command "
"should be in the source directory root.";
}
cmTypeMacro(cmEnableTestingCommand, cmCommand);
};

View File

@@ -54,24 +54,6 @@ public:
*/
virtual const char* GetName() const { return "endforeach";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Ends a list of commands in a FOREACH block.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" endforeach(expression)\n"
"See the FOREACH command.";
}
cmTypeMacro(cmEndForEachCommand, cmCommand);
};

View File

@@ -54,24 +54,6 @@ public:
*/
virtual const char* GetName() const { return "endfunction";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Ends a list of commands in a function block.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" endfunction(expression)\n"
"See the function command.";
}
cmTypeMacro(cmEndFunctionCommand, cmCommand);
};

View File

@@ -47,24 +47,6 @@ public:
*/
virtual const char* GetName() const { return "endif";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Ends a list of commands in an if block.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" endif(expression)\n"
"See the if command.";
}
cmTypeMacro(cmEndIfCommand, cmCommand);
};

View File

@@ -54,24 +54,6 @@ public:
*/
virtual const char* GetName() const { return "endmacro";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Ends a list of commands in a macro block.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" endmacro(expression)\n"
"See the macro command.";
}
cmTypeMacro(cmEndMacroCommand, cmCommand);
};

View File

@@ -54,24 +54,6 @@ public:
*/
virtual const char* GetName() const { return "endwhile";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Ends a list of commands in a while block.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" endwhile(expression)\n"
"See the while command.";
}
cmTypeMacro(cmEndWhileCommand, cmCommand);
};

View File

@@ -50,39 +50,6 @@ public:
*/
virtual bool IsScriptable() const { return true; }
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return
"Deprecated. Use the execute_process() command instead.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
"Run an executable program during the processing of the CMakeList.txt"
" file.\n"
" exec_program(Executable [directory in which to run]\n"
" [ARGS <arguments to executable>]\n"
" [OUTPUT_VARIABLE <var>]\n"
" [RETURN_VALUE <var>])\n"
"The executable is run in the optionally specified directory. The "
"executable can include arguments if it is double quoted, but it is "
"better to use the optional ARGS argument to specify arguments to the "
"program. This is because cmake will then be able to escape spaces "
"in the executable path. An optional argument OUTPUT_VARIABLE "
"specifies a variable in which to store the output. "
"To capture the return value of the execution, provide a RETURN_VALUE. "
"If OUTPUT_VARIABLE is specified, then no output will go to the "
"stdout/stderr of the console running cmake.\n"
;
}
/** This command is kept for compatibility with older CMake versions. */
virtual bool IsDiscouraged() const
{

View File

@@ -49,64 +49,6 @@ public:
*/
virtual bool IsScriptable() const { return true; }
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Execute one or more child processes.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" execute_process(COMMAND <cmd1> [args1...]]\n"
" [COMMAND <cmd2> [args2...] [...]]\n"
" [WORKING_DIRECTORY <directory>]\n"
" [TIMEOUT <seconds>]\n"
" [RESULT_VARIABLE <variable>]\n"
" [OUTPUT_VARIABLE <variable>]\n"
" [ERROR_VARIABLE <variable>]\n"
" [INPUT_FILE <file>]\n"
" [OUTPUT_FILE <file>]\n"
" [ERROR_FILE <file>]\n"
" [OUTPUT_QUIET]\n"
" [ERROR_QUIET]\n"
" [OUTPUT_STRIP_TRAILING_WHITESPACE]\n"
" [ERROR_STRIP_TRAILING_WHITESPACE])\n"
"Runs the given sequence of one or more commands with the standard "
"output of each process piped to the standard input of the next. "
"A single standard error pipe is used for all processes. "
"If WORKING_DIRECTORY is given the named directory will be set as "
"the current working directory of the child processes. "
"If TIMEOUT is given the child processes will be terminated if they "
"do not finish in the specified number of seconds "
"(fractions are allowed). "
"If RESULT_VARIABLE is given the variable will be set to contain "
"the result of running the processes. This will be an integer return "
"code from the last child or a string describing an error condition. "
"If OUTPUT_VARIABLE or ERROR_VARIABLE are given the variable named "
"will be set with the contents of the standard output and standard "
"error pipes respectively. If the same variable is named for both "
"pipes their output will be merged in the order produced. "
"If INPUT_FILE, OUTPUT_FILE, or ERROR_FILE is given the file named "
"will be attached to the standard input of the first process, "
"standard output of the last process, or standard error of all "
"processes respectively. "
"If OUTPUT_QUIET or ERROR_QUIET is given then the standard output "
"or standard error results will be quietly ignored. "
"If more than one OUTPUT_* or ERROR_* option is given for the same "
"pipe the precedence is not specified. "
"If no OUTPUT_* or ERROR_* options are given the output will be shared "
"with the corresponding pipes of the CMake process itself.\n"
"The execute_process command is a newer more powerful version of "
"exec_program, but the old command has been kept for compatibility."
;
}
cmTypeMacro(cmExecuteProcessCommand, cmCommand);
};

View File

@@ -13,7 +13,6 @@
#define cmExportCommand_h
#include "cmCommand.h"
#include "cmDocumentLocationUndefined.h"
class cmExportBuildFileGenerator;
@@ -47,61 +46,6 @@ public:
*/
virtual const char* GetName() const { return "export";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return
"Export targets from the build tree for use by outside projects.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" export(TARGETS [target1 [target2 [...]]] [NAMESPACE <namespace>]\n"
" [APPEND] FILE <filename> [EXPORT_LINK_INTERFACE_LIBRARIES])\n"
"Create a file <filename> that may be included by outside projects to "
"import targets from the current project's build tree. "
"This is useful during cross-compiling to build utility executables "
"that can run on the host platform in one project and then import "
"them into another project being compiled for the target platform. "
"If the NAMESPACE option is given the <namespace> string will be "
"prepended to all target names written to the file. "
"If the APPEND option is given the generated code will be appended "
"to the file instead of overwriting it. "
"The EXPORT_LINK_INTERFACE_LIBRARIES keyword, if present, causes the "
"contents of the properties matching "
"(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? to be exported, when "
"policy CMP0022 is NEW. "
"If a library target is included in the export but "
"a target to which it links is not included the behavior is "
"unspecified."
"\n"
"The file created by this command is specific to the build tree and "
"should never be installed. "
"See the install(EXPORT) command to export targets from an "
"installation tree."
"\n"
"The properties set on the generated IMPORTED targets will have the "
"same values as the final values of the input TARGETS."
"\n"
" export(PACKAGE <name>)\n"
"Store the current build directory in the CMake user package registry "
"for package <name>. "
"The find_package command may consider the directory while searching "
"for package <name>. "
"This helps dependent projects find and use a package from the "
"current project's build tree without help from the user. "
"Note that the entry in the package registry that this command "
"creates works only in conjunction with a package configuration "
"file (<name>Config.cmake) that works with the build tree."
;
}
cmTypeMacro(cmExportCommand, cmCommand);
private:

View File

@@ -50,38 +50,6 @@ public:
*/
virtual const char* GetName() const { return "export_library_dependencies";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Deprecated. Use INSTALL(EXPORT) or EXPORT command.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
"This command generates an old-style library dependencies file. "
"Projects requiring CMake 2.6 or later should not use the command. "
"Use instead the install(EXPORT) command to help export targets "
"from an installation tree and the export() command to export targets "
"from a build tree.\n"
"The old-style library dependencies file does not take into account "
"per-configuration names of libraries or the LINK_INTERFACE_LIBRARIES "
"target property.\n"
" export_library_dependencies(<file> [APPEND])\n"
"Create a file named <file> that can be included into a CMake listfile "
"with the INCLUDE command. The file will contain a number of SET "
"commands that will set all the variables needed for library dependency "
"information. This should be the last command in the top level "
"CMakeLists.txt file of the project. If the APPEND option is "
"specified, the SET commands will be appended to the given file "
"instead of replacing it.";
}
/** This command is kept for compatibility with older CMake versions. */
virtual bool IsDiscouraged() const
{

View File

@@ -42,13 +42,6 @@ void cmExtraCodeBlocksGenerator
{
entry.Name = this->GetName();
entry.Brief = "Generates CodeBlocks project files.";
entry.Full =
"Project files for CodeBlocks will be created in the top directory "
"and in every subdirectory which features a CMakeLists.txt file "
"containing a PROJECT() call. "
"Additionally a hierarchy of makefiles is generated into the "
"build tree. The appropriate make program can build the project through "
"the default make target. A \"make install\" target is also provided.";
}
cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator()

View File

@@ -48,13 +48,6 @@ void cmExtraEclipseCDT4Generator
{
entry.Name = this->GetName();
entry.Brief = "Generates Eclipse CDT 4.0 project files.";
entry.Full =
"Project files for Eclipse will be created in the top directory. "
"In out of source builds, a linked resource to the top level source "
"directory will be created. "
"Additionally a hierarchy of makefiles is generated into the "
"build tree. The appropriate make program can build the project through "
"the default make target. A \"make install\" target is also provided.";
}
//----------------------------------------------------------------------------

View File

@@ -45,13 +45,6 @@ void cmExtraSublimeTextGenerator
{
entry.Name = this->GetName();
entry.Brief = "Generates Sublime Text 2 project files.";
entry.Full =
"Project files for Sublime Text 2 will be created in the top directory "
"and in every subdirectory which features a CMakeLists.txt file "
"containing a PROJECT() call. "
"Additionally Makefiles (or build.ninja files) are generated into the "
"build tree. The appropriate make program can build the project through "
"the default make target. A \"make install\" target is also provided.";
}
cmExtraSublimeTextGenerator::cmExtraSublimeTextGenerator()

View File

@@ -54,28 +54,6 @@ public:
*/
virtual const char* GetName() const { return "fltk_wrap_ui";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Create FLTK user interfaces Wrappers.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" fltk_wrap_ui(resultingLibraryName source1\n"
" source2 ... sourceN )\n"
"Produce .h and .cxx files for all the .fl and .fld files listed. "
"The resulting .h and .cxx files will be added to a variable named "
"resultingLibraryName_FLTK_UI_SRCS which should be added to your "
"library.";
}
private:
/**
* List of produced files.

View File

@@ -48,213 +48,6 @@ public:
*/
virtual const char* GetName() const { return "file";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "File manipulation command.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const
{
return
" file(WRITE filename \"message to write\"... )\n"
" file(APPEND filename \"message to write\"... )\n"
" file(READ filename variable [LIMIT numBytes] [OFFSET offset] [HEX])\n"
" file(<MD5|SHA1|SHA224|SHA256|SHA384|SHA512> filename variable)\n"
" file(STRINGS filename variable [LIMIT_COUNT num]\n"
" [LIMIT_INPUT numBytes] [LIMIT_OUTPUT numBytes]\n"
" [LENGTH_MINIMUM numBytes] [LENGTH_MAXIMUM numBytes]\n"
" [NEWLINE_CONSUME] [REGEX regex]\n"
" [NO_HEX_CONVERSION])\n"
" file(GLOB variable [RELATIVE path] [globbing expressions]...)\n"
" file(GLOB_RECURSE variable [RELATIVE path] \n"
" [FOLLOW_SYMLINKS] [globbing expressions]...)\n"
" file(RENAME <oldname> <newname>)\n"
" file(REMOVE [file1 ...])\n"
" file(REMOVE_RECURSE [file1 ...])\n"
" file(MAKE_DIRECTORY [directory1 directory2 ...])\n"
" file(RELATIVE_PATH variable directory file)\n"
" file(TO_CMAKE_PATH path result)\n"
" file(TO_NATIVE_PATH path result)\n"
" file(DOWNLOAD url file [INACTIVITY_TIMEOUT timeout]\n"
" [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS]\n"
" [EXPECTED_HASH ALGO=value] [EXPECTED_MD5 sum]\n"
" [TLS_VERIFY on|off] [TLS_CAINFO file])\n"
" file(UPLOAD filename url [INACTIVITY_TIMEOUT timeout]\n"
" [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS])\n"
" file(TIMESTAMP filename variable [<format string>] [UTC])\n"
" file(GENERATE OUTPUT output_file\n"
" <INPUT input_file|CONTENT input_content>\n"
" [CONDITION expression])\n"
"WRITE will write a message into a file called 'filename'. It "
"overwrites the file if it already exists, and creates the file "
"if it does not exist. (If the file is a build input, use "
"configure_file to update the file only when its content changes.)\n"
"APPEND will write a message into a file same as WRITE, except "
"it will append it to the end of the file\n"
"READ will read the content of a file and store it into the "
"variable. It will start at the given offset and read up to numBytes. "
"If the argument HEX is given, the binary data will be converted to "
"hexadecimal representation and this will be stored in the variable.\n"
"MD5, SHA1, SHA224, SHA256, SHA384, and SHA512 "
"will compute a cryptographic hash of the content of a file.\n"
"STRINGS will parse a list of ASCII strings from a file and "
"store it in a variable. Binary data in the file are ignored. Carriage "
"return (CR) characters are ignored. It works also for Intel Hex and "
"Motorola S-record files, which are automatically converted to binary "
"format when reading them. Disable this using NO_HEX_CONVERSION.\n"
"LIMIT_COUNT sets the maximum number of strings to return. "
"LIMIT_INPUT sets the maximum number of bytes to read from "
"the input file. "
"LIMIT_OUTPUT sets the maximum number of bytes to store in the "
"output variable. "
"LENGTH_MINIMUM sets the minimum length of a string to return. "
"Shorter strings are ignored. "
"LENGTH_MAXIMUM sets the maximum length of a string to return. Longer "
"strings are split into strings no longer than the maximum length. "
"NEWLINE_CONSUME allows newlines to be included in strings instead "
"of terminating them.\n"
"REGEX specifies a regular expression that a string must match to be "
"returned. Typical usage \n"
" file(STRINGS myfile.txt myfile)\n"
"stores a list in the variable \"myfile\" in which each item is "
"a line from the input file.\n"
"GLOB will generate a list of all files that match the globbing "
"expressions and store it into the variable. Globbing expressions "
"are similar to regular expressions, but much simpler. If RELATIVE "
"flag is specified for an expression, the results will be returned "
"as a relative path to the given path. "
"(We do not recommend using GLOB to collect a list of source files "
"from your source tree. If no CMakeLists.txt file changes when a "
"source is added or removed then the generated build system cannot "
"know when to ask CMake to regenerate.)"
"\n"
"Examples of globbing expressions include:\n"
" *.cxx - match all files with extension cxx\n"
" *.vt? - match all files with extension vta,...,vtz\n"
" f[3-5].txt - match files f3.txt, f4.txt, f5.txt\n"
"GLOB_RECURSE will generate a list similar to the regular GLOB, except "
"it will traverse all the subdirectories of the matched directory and "
"match the files. Subdirectories that are symlinks are only traversed "
"if FOLLOW_SYMLINKS is given or cmake policy CMP0009 is not set to NEW. "
"See cmake --help-policy CMP0009 for more information.\n"
"Examples of recursive globbing include:\n"
" /dir/*.py - match all python files in /dir and subdirectories\n"
"MAKE_DIRECTORY will create the given directories, also if their parent "
"directories don't exist yet\n"
"RENAME moves a file or directory within a filesystem, "
"replacing the destination atomically."
"\n"
"REMOVE will remove the given files, also in subdirectories\n"
"REMOVE_RECURSE will remove the given files and directories, also "
"non-empty directories\n"
"RELATIVE_PATH will determine relative path from directory to the given"
" file.\n"
"TO_CMAKE_PATH will convert path into a cmake style path with unix /. "
" The input can be a single path or a system path like \"$ENV{PATH}\". "
" Note the double quotes around the ENV call TO_CMAKE_PATH only takes "
" one argument. This command will also convert the native list"
" delimiters for a list of paths like the PATH environment variable.\n"
"TO_NATIVE_PATH works just like TO_CMAKE_PATH, but will convert from "
" a cmake style path into the native path style \\ for windows and / "
"for UNIX.\n"
"DOWNLOAD will download the given URL to the given file. "
"If LOG var is specified a log of the download will be put in var. "
"If STATUS var is specified the status of the operation will"
" be put in var. The status is returned in a list of length 2. "
"The first element is the numeric return value for the operation, "
"and the second element is a string value for the error. A 0 "
"numeric error means no error in the operation. "
"If TIMEOUT time is specified, the operation will "
"timeout after time seconds, time should be specified as an integer. "
"The INACTIVITY_TIMEOUT specifies an integer number of seconds of "
"inactivity after which the operation should terminate. "
"If EXPECTED_HASH ALGO=value is specified, the operation will verify "
"that the downloaded file's actual hash matches the expected value, "
"where ALGO is one of MD5, SHA1, SHA224, SHA256, SHA384, or SHA512. "
"If it does not match, the operation fails with an error. "
"(\"EXPECTED_MD5 sum\" is short-hand for \"EXPECTED_HASH MD5=sum\".) "
"If SHOW_PROGRESS is specified, progress information will be printed "
"as status messages until the operation is complete. "
"For https URLs CMake must be built with OpenSSL. "
"TLS/SSL certificates are not checked by default. "
"Set TLS_VERIFY to ON to check certificates and/or use "
"EXPECTED_HASH to verify downloaded content. "
"Set TLS_CAINFO to specify a custom Certificate Authority file. "
"If either TLS option is not given CMake will check variables "
"CMAKE_TLS_VERIFY and CMAKE_TLS_CAINFO, "
"respectively."
"\n"
"UPLOAD will upload the given file to the given URL. "
"If LOG var is specified a log of the upload will be put in var. "
"If STATUS var is specified the status of the operation will"
" be put in var. The status is returned in a list of length 2. "
"The first element is the numeric return value for the operation, "
"and the second element is a string value for the error. A 0 "
"numeric error means no error in the operation. "
"If TIMEOUT time is specified, the operation will "
"timeout after time seconds, time should be specified as an integer. "
"The INACTIVITY_TIMEOUT specifies an integer number of seconds of "
"inactivity after which the operation should terminate. "
"If SHOW_PROGRESS is specified, progress information will be printed "
"as status messages until the operation is complete."
"\n"
"TIMESTAMP will write a string representation of "
"the modification time of filename to variable.\n"
"Should the command be unable to obtain a timestamp "
"variable will be set to the empty string \"\".\n"
"See documentation of the string TIMESTAMP sub-command for more details."
"\n"
"The file() command also provides COPY and INSTALL signatures:\n"
" file(<COPY|INSTALL> files... DESTINATION <dir>\n"
" [FILE_PERMISSIONS permissions...]\n"
" [DIRECTORY_PERMISSIONS permissions...]\n"
" [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS]\n"
" [FILES_MATCHING]\n"
" [[PATTERN <pattern> | REGEX <regex>]\n"
" [EXCLUDE] [PERMISSIONS permissions...]] [...])\n"
"The COPY signature copies files, directories, and symlinks to a "
"destination folder. "
"Relative input paths are evaluated with respect to the current "
"source directory, and a relative destination is evaluated with "
"respect to the current build directory. "
"Copying preserves input file timestamps, and optimizes out a file "
"if it exists at the destination with the same timestamp. "
"Copying preserves input permissions unless explicit permissions or "
"NO_SOURCE_PERMISSIONS are given (default is USE_SOURCE_PERMISSIONS). "
"See the install(DIRECTORY) command for documentation of permissions, "
"PATTERN, REGEX, and EXCLUDE options. "
"\n"
"The INSTALL signature differs slightly from COPY: "
"it prints status messages, and NO_SOURCE_PERMISSIONS is default. "
"Installation scripts generated by the install() command use this "
"signature (with some undocumented options for internal use)."
"\n"
"GENERATE will write an <output_file> with content from an "
"<input_file>, or from <input_content>. The output is generated "
"conditionally based on the content of the <condition>. The file is "
"written at CMake generate-time and the input may contain generator "
"expressions. The <condition>, <output_file> and <input_file> may "
"also contain generator expressions. The <condition> must evaluate to "
"either '0' or '1'. The <output_file> must evaluate to a unique name "
"among all configurations and among all invocations of file(GENERATE)."
// Undocumented INSTALL options:
// - RENAME <name>
// - OPTIONAL
// - FILES keyword to re-enter files... list
// - PERMISSIONS before REGEX is alias for FILE_PERMISSIONS
// - DIR_PERMISSIONS is alias for DIRECTORY_PERMISSIONS
// - TYPE <FILE|DIRECTORY|EXECUTABLE|PROGRAM|
// STATIC_LIBRARY|SHARED_LIBRARY|MODULE>
// - COMPONENTS, CONFIGURATIONS, PROPERTIES (ignored for compat)
;
}
cmTypeMacro(cmFileCommand, cmCommand);
protected:

View File

@@ -19,106 +19,6 @@ cmFindBase::cmFindBase()
this->NamesPerDirAllowed = false;
}
//----------------------------------------------------------------------------
void cmFindBase::GenerateDocumentation()
{
this->cmFindCommon::GenerateDocumentation();
cmSystemTools::ReplaceString(this->GenericDocumentationPathsOrder,
"FIND_ARGS_XXX", "<VAR> NAMES name");
this->GenericDocumentation =
" FIND_XXX(<VAR> name1 [path1 path2 ...])\n"
"This is the short-hand signature for the command that "
"is sufficient in many cases. It is the same "
"as FIND_XXX(<VAR> name1 [PATHS path1 path2 ...])\n"
" FIND_XXX(\n"
" <VAR>\n"
" name | NAMES name1 [name2 ...]\n"
" [HINTS path1 [path2 ... ENV var]]\n"
" [PATHS path1 [path2 ... ENV var]]\n"
" [PATH_SUFFIXES suffix1 [suffix2 ...]]\n"
" [DOC \"cache documentation string\"]\n"
" [NO_DEFAULT_PATH]\n"
" [NO_CMAKE_ENVIRONMENT_PATH]\n"
" [NO_CMAKE_PATH]\n"
" [NO_SYSTEM_ENVIRONMENT_PATH]\n"
" [NO_CMAKE_SYSTEM_PATH]\n"
" [CMAKE_FIND_ROOT_PATH_BOTH |\n"
" ONLY_CMAKE_FIND_ROOT_PATH |\n"
" NO_CMAKE_FIND_ROOT_PATH]\n"
" )\n"
""
"This command is used to find a SEARCH_XXX_DESC. "
"A cache entry named by <VAR> is created to store the result "
"of this command. "
"If the SEARCH_XXX is found the result is stored in the variable "
"and the search will not be repeated unless the variable is cleared. "
"If nothing is found, the result will be "
"<VAR>-NOTFOUND, and the search will be attempted again the "
"next time FIND_XXX is invoked with the same variable. "
"The name of the SEARCH_XXX that "
"is searched for is specified by the names listed "
"after the NAMES argument. Additional search locations "
"can be specified after the PATHS argument. If ENV var is "
"found in the HINTS or PATHS section the environment variable var "
"will be read and converted from a system environment variable to "
"a cmake style list of paths. For example ENV PATH would be a way "
"to list the system path variable. The argument "
"after DOC will be used for the documentation string in "
"the cache. "
"PATH_SUFFIXES specifies additional subdirectories to check below "
"each search path."
"\n"
"If NO_DEFAULT_PATH is specified, then no additional paths are "
"added to the search. "
"If NO_DEFAULT_PATH is not specified, the search process is as follows:\n"
"1. Search paths specified in cmake-specific cache variables. "
"These are intended to be used on the command line with a -DVAR=value. "
"This can be skipped if NO_CMAKE_PATH is passed.\n"
"XXX_EXTRA_PREFIX_ENTRY"
" <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_PREFIX_PATH\n"
" CMAKE_XXX_PATH\n"
" CMAKE_XXX_MAC_PATH\n"
"2. Search paths specified in cmake-specific environment variables. "
"These are intended to be set in the user's shell configuration. "
"This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.\n"
"XXX_EXTRA_PREFIX_ENTRY"
" <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_PREFIX_PATH\n"
" CMAKE_XXX_PATH\n"
" CMAKE_XXX_MAC_PATH\n"
"3. Search the paths specified by the HINTS option. "
"These should be paths computed by system introspection, such as a "
"hint provided by the location of another item already found. "
"Hard-coded guesses should be specified with the PATHS option.\n"
"4. Search the standard system environment variables. "
"This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.\n"
" PATH\n"
" XXX_SYSTEM\n" // replace with "", LIB, or INCLUDE
"5. Search cmake variables defined in the Platform files "
"for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH "
"is passed.\n"
"XXX_EXTRA_PREFIX_ENTRY"
" <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH\n"
" CMAKE_SYSTEM_XXX_PATH\n"
" CMAKE_SYSTEM_XXX_MAC_PATH\n"
"6. Search the paths specified by the PATHS option "
"or in the short-hand version of the command. "
"These are typically hard-coded guesses.\n"
;
this->GenericDocumentation += this->GenericDocumentationMacPolicy;
this->GenericDocumentation += this->GenericDocumentationRootPath;
this->GenericDocumentation += this->GenericDocumentationPathsOrder;
}
//----------------------------------------------------------------------------
const char* cmFindBase::GetFullDocumentation() const
{
if(this->GenericDocumentation.empty())
{
const_cast<cmFindBase *>(this)->GenerateDocumentation();
}
return this->GenericDocumentation.c_str();
}
//----------------------------------------------------------------------------
bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
{

View File

@@ -31,10 +31,7 @@ public:
virtual bool ParseArguments(std::vector<std::string> const& args);
cmTypeMacro(cmFindBase, cmFindCommon);
virtual const char* GetFullDocumentation() const;
protected:
virtual void GenerateDocumentation();
void PrintFindStuff();
void ExpandPaths();
void AddPathSuffixes();
@@ -44,7 +41,6 @@ protected:
// if it has documentation in the cache
bool CheckForVariableInCache();
cmStdString GenericDocumentation;
// use by command during find
cmStdString VariableDocumentation;
cmStdString VariableName;

View File

@@ -36,55 +36,6 @@ cmFindCommon::cmFindCommon()
this->SearchAppBundleLast = false;
}
//----------------------------------------------------------------------------
void cmFindCommon::GenerateDocumentation()
{
// Documentation components.
this->GenericDocumentationMacPolicy =
"On Darwin or systems supporting OS X Frameworks, the cmake variable"
" CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:\n"
" \"FIRST\" - Try to find frameworks before standard\n"
" libraries or headers. This is the default on Darwin.\n"
" \"LAST\" - Try to find frameworks after standard\n"
" libraries or headers.\n"
" \"ONLY\" - Only try to find frameworks.\n"
" \"NEVER\" - Never try to find frameworks.\n"
"On Darwin or systems supporting OS X Application Bundles, the cmake "
"variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the "
"following:\n"
" \"FIRST\" - Try to find application bundles before standard\n"
" programs. This is the default on Darwin.\n"
" \"LAST\" - Try to find application bundles after standard\n"
" programs.\n"
" \"ONLY\" - Only try to find application bundles.\n"
" \"NEVER\" - Never try to find application bundles.\n";
this->GenericDocumentationRootPath =
"The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more "
"directories to be prepended to all other search directories. "
"This effectively \"re-roots\" the entire search under given locations. "
"By default it is empty. It is especially useful when "
"cross-compiling to point to the root directory of the "
"target environment and CMake will search there too. By default at first "
"the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted "
"directories will be searched. "
"The default behavior can be adjusted by setting "
"CMAKE_FIND_ROOT_PATH_MODE_XXX. This behavior can be manually "
"overridden on a per-call basis. "
"By using CMAKE_FIND_ROOT_PATH_BOTH the search order will "
"be as described above. If NO_CMAKE_FIND_ROOT_PATH is used "
"then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH "
"is used then only the re-rooted directories will be searched.\n";
this->GenericDocumentationPathsOrder =
"The default search order is designed to be most-specific to "
"least-specific for common use cases. "
"Projects may override the order by simply calling the command "
"multiple times and using the NO_* options:\n"
" FIND_XXX(FIND_ARGS_XXX PATHS paths... NO_DEFAULT_PATH)\n"
" FIND_XXX(FIND_ARGS_XXX)\n"
"Once one of the calls succeeds the result variable will be set "
"and stored in the cache so that no call will search again.";
}
//----------------------------------------------------------------------------
cmFindCommon::~cmFindCommon()
{

View File

@@ -56,8 +56,6 @@ protected:
/** Compute the current default bundle/framework search policy. */
void SelectDefaultMacMode();
virtual void GenerateDocumentation();
cmStdString CMakePathName;
RootPathMode FindRootPathMode;
@@ -85,10 +83,6 @@ protected:
std::vector<std::string> SearchPaths;
std::set<cmStdString> SearchPathsEmitted;
std::string GenericDocumentationMacPolicy;
std::string GenericDocumentationRootPath;
std::string GenericDocumentationPathsOrder;
bool SearchFrameworkFirst;
bool SearchFrameworkOnly;
bool SearchFrameworkLast;

View File

@@ -16,15 +16,3 @@ cmFindFileCommand::cmFindFileCommand()
{
this->IncludeFileInPath = true;
}
void cmFindFileCommand::GenerateDocumentation()
{
this->cmFindPathCommand::GenerateDocumentation();
cmSystemTools::ReplaceString(this->GenericDocumentation,
"find_path", "find_file");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"directory containing the named file",
"full path to named file");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"file in a directory", "full path to a file");
}

View File

@@ -35,17 +35,7 @@ public:
}
virtual const char* GetName() const { return "find_file";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Find the full path to a file.";
}
cmTypeMacro(cmFindFileCommand, cmFindPathCommand);
protected:
virtual void GenerateDocumentation();
};

View File

@@ -20,62 +20,6 @@ cmFindLibraryCommand::cmFindLibraryCommand()
this->NamesPerDirAllowed = true;
}
//----------------------------------------------------------------------------
void cmFindLibraryCommand::GenerateDocumentation()
{
this->cmFindBase::GenerateDocumentation();
cmSystemTools::ReplaceString(this->GenericDocumentation,
"FIND_XXX", "find_library");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_XXX_PATH", "CMAKE_LIBRARY_PATH");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_XXX_MAC_PATH",
"CMAKE_FRAMEWORK_PATH");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_SYSTEM_XXX_MAC_PATH",
"CMAKE_SYSTEM_FRAMEWORK_PATH");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"XXX_SYSTEM", "LIB");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_SYSTEM_XXX_PATH",
"CMAKE_SYSTEM_LIBRARY_PATH");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"SEARCH_XXX_DESC", "library");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"SEARCH_XXX", "library");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"XXX_SUBDIR", "lib");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"NAMES name1 [name2 ...]",
"NAMES name1 [name2 ...] [NAMES_PER_DIR]");
cmSystemTools::ReplaceString(
this->GenericDocumentation,
"XXX_EXTRA_PREFIX_ENTRY",
" <prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and\n");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_FIND_ROOT_PATH_MODE_XXX",
"CMAKE_FIND_ROOT_PATH_MODE_LIBRARY");
this->GenericDocumentation +=
"\n"
"When more than one value is given to the NAMES option this command "
"by default will consider one name at a time and search every directory "
"for it. "
"The NAMES_PER_DIR option tells this command to consider one directory "
"at a time and search for all names in it."
"\n"
"If the library found is a framework, then VAR will be set to "
"the full path to the framework <fullPath>/A.framework. "
"When a full path to a framework is used as a library, "
"CMake will use a -framework A, and a -F<fullPath> to "
"link the framework to the target."
"\n"
"If the global property FIND_LIBRARY_USE_LIB64_PATHS is set all search "
"paths will be tested as normal, with \"64/\" appended, and with all "
"matches of \"lib/\" replaced with \"lib64/\". This property is "
"automatically set for the platforms that are known to need it if at "
"least one of the languages supported by the PROJECT command is enabled.";
}
// cmFindLibraryCommand
bool cmFindLibraryCommand
::InitialPass(std::vector<std::string> const& argsIn, cmExecutionStatus &)

View File

@@ -51,13 +51,6 @@ public:
*/
virtual const char* GetName() const {return "find_library";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Find a library.";
}
cmTypeMacro(cmFindLibraryCommand, cmFindBase);
protected:
@@ -67,7 +60,6 @@ protected:
const char* suffix,
bool fresh = true);
std::string FindLibrary();
virtual void GenerateDocumentation();
private:
std::string FindNormalLibrary();
std::string FindNormalLibraryNamesPerDir();

View File

@@ -78,322 +78,6 @@ cmFindPackageCommand::cmFindPackageCommand()
this->RequiredCMakeVersion = 0;
}
//----------------------------------------------------------------------------
void cmFindPackageCommand::GenerateDocumentation()
{
this->cmFindCommon::GenerateDocumentation();
cmSystemTools::ReplaceString(this->GenericDocumentationRootPath,
"CMAKE_FIND_ROOT_PATH_MODE_XXX",
"CMAKE_FIND_ROOT_PATH_MODE_PACKAGE");
cmSystemTools::ReplaceString(this->GenericDocumentationPathsOrder,
"FIND_ARGS_XXX", "<package>");
cmSystemTools::ReplaceString(this->GenericDocumentationPathsOrder,
"FIND_XXX", "find_package");
this->CommandDocumentation =
" find_package(<package> [version] [EXACT] [QUIET] [MODULE]\n"
" [REQUIRED] [[COMPONENTS] [components...]]\n"
" [OPTIONAL_COMPONENTS components...]\n"
" [NO_POLICY_SCOPE])\n"
"Finds and loads settings from an external project. "
"<package>_FOUND will be set to indicate whether the package was found. "
"When the package is found package-specific information is provided "
"through variables and imported targets documented by the package "
"itself. "
"The QUIET option disables messages if the package cannot be found. "
"The MODULE option disables the second signature documented below. "
"The REQUIRED option stops processing with an error message if the "
"package cannot be found."
"\n"
"A package-specific list of required components may be listed after the "
"COMPONENTS option (or after the REQUIRED option if present). "
"Additional optional components may be listed after OPTIONAL_COMPONENTS. "
"Available components and their influence on whether a package is "
"considered to be found are defined by the target package."
"\n"
"The [version] argument requests a version with which the package found "
"should be compatible (format is major[.minor[.patch[.tweak]]]). "
"The EXACT option requests that the version be matched exactly. "
"If no [version] and/or component list is given to a recursive "
"invocation inside a find-module, the corresponding arguments "
"are forwarded automatically from the outer call (including the "
"EXACT flag for [version]). "
"Version support is currently provided only on a package-by-package "
"basis (details below).\n"
"User code should generally look for packages using the above simple "
"signature. The remainder of this command documentation specifies the "
"full command signature and details of the search process. Project "
"maintainers wishing to provide a package to be found by this command "
"are encouraged to read on.\n"
"The command has two modes by which it searches for packages: "
"\"Module\" mode and \"Config\" mode. "
"Module mode is available when the command is invoked with the above "
"reduced signature. "
"CMake searches for a file called \"Find<package>.cmake\" in "
"the CMAKE_MODULE_PATH followed by the CMake installation. "
"If the file is found, it is read and processed by CMake. "
"It is responsible for finding the package, checking the version, "
"and producing any needed messages. "
"Many find-modules provide limited or no support for versioning; "
"check the module documentation. "
"If no module is found and the MODULE option is not given the command "
"proceeds to Config mode.\n"
"The complete Config mode command signature is:\n"
" find_package(<package> [version] [EXACT] [QUIET]\n"
" [REQUIRED] [[COMPONENTS] [components...]]\n"
" [CONFIG|NO_MODULE]\n"
" [NO_POLICY_SCOPE]\n"
" [NAMES name1 [name2 ...]]\n"
" [CONFIGS config1 [config2 ...]]\n"
" [HINTS path1 [path2 ... ]]\n"
" [PATHS path1 [path2 ... ]]\n"
" [PATH_SUFFIXES suffix1 [suffix2 ...]]\n"
" [NO_DEFAULT_PATH]\n"
" [NO_CMAKE_ENVIRONMENT_PATH]\n"
" [NO_CMAKE_PATH]\n"
" [NO_SYSTEM_ENVIRONMENT_PATH]\n"
" [NO_CMAKE_PACKAGE_REGISTRY]\n"
" [NO_CMAKE_BUILDS_PATH]\n"
" [NO_CMAKE_SYSTEM_PATH]\n"
" [NO_CMAKE_SYSTEM_PACKAGE_REGISTRY]\n"
" [CMAKE_FIND_ROOT_PATH_BOTH |\n"
" ONLY_CMAKE_FIND_ROOT_PATH |\n"
" NO_CMAKE_FIND_ROOT_PATH])\n"
"The CONFIG option may be used to skip Module mode explicitly and "
"switch to Config mode. It is synonymous to using NO_MODULE. "
"Config mode is also implied by use of options not specified in the "
"reduced signature. "
"\n"
"Config mode attempts to locate a configuration file provided by the "
"package to be found. A cache entry called <package>_DIR is created to "
"hold the directory containing the file. "
"By default the command searches for a package with the name <package>. "
"If the NAMES option is given the names following it are used instead "
"of <package>. "
"The command searches for a file called \"<name>Config.cmake\" or "
"\"<lower-case-name>-config.cmake\" for each name specified. "
"A replacement set of possible configuration file names may be given "
"using the CONFIGS option. "
"The search procedure is specified below. Once found, the configuration "
"file is read and processed by CMake. Since the file is provided by the "
"package it already knows the location of package contents. "
"The full path to the configuration file is stored in the cmake "
"variable <package>_CONFIG."
"\n"
"All configuration files which have been considered by CMake while "
"searching for an installation of the package with an appropriate "
"version are stored in the cmake variable <package>_CONSIDERED_CONFIGS, "
"the associated versions in <package>_CONSIDERED_VERSIONS. "
"\n"
"If the package configuration file cannot be found CMake "
"will generate an error describing the problem unless the QUIET "
"argument is specified. If REQUIRED is specified and the package "
"is not found a fatal error is generated and the configure step stops "
"executing. If <package>_DIR has been set to a directory not containing "
"a configuration file CMake will ignore it and search from scratch."
"\n"
"When the [version] argument is given Config mode will only find a "
"version of the package that claims compatibility with the requested "
"version (format is major[.minor[.patch[.tweak]]]). "
"If the EXACT option is given only a version of the package claiming "
"an exact match of the requested version may be found. "
"CMake does not establish any convention for the meaning of version "
"numbers. "
"Package version numbers are checked by \"version\" files provided by "
"the packages themselves. "
"For a candidate package configuration file \"<config-file>.cmake\" the "
"corresponding version file is located next to it and named either "
"\"<config-file>-version.cmake\" or \"<config-file>Version.cmake\". "
"If no such version file is available then the configuration file "
"is assumed to not be compatible with any requested version. "
"A basic version file containing generic version matching code can be "
"created using the macro write_basic_package_version_file(), see its "
"documentation for more details. "
"When a version file is found it is loaded to check the requested "
"version number. "
"The version file is loaded in a nested scope in which the following "
"variables have been defined:\n"
" PACKAGE_FIND_NAME = the <package> name\n"
" PACKAGE_FIND_VERSION = full requested version string\n"
" PACKAGE_FIND_VERSION_MAJOR = major version if requested, else 0\n"
" PACKAGE_FIND_VERSION_MINOR = minor version if requested, else 0\n"
" PACKAGE_FIND_VERSION_PATCH = patch version if requested, else 0\n"
" PACKAGE_FIND_VERSION_TWEAK = tweak version if requested, else 0\n"
" PACKAGE_FIND_VERSION_COUNT = number of version components, 0 to 4\n"
"The version file checks whether it satisfies the requested version "
"and sets these variables:\n"
" PACKAGE_VERSION = full provided version string\n"
" PACKAGE_VERSION_EXACT = true if version is exact match\n"
" PACKAGE_VERSION_COMPATIBLE = true if version is compatible\n"
" PACKAGE_VERSION_UNSUITABLE = true if unsuitable as any version\n"
"These variables are checked by the find_package command to determine "
"whether the configuration file provides an acceptable version. "
"They are not available after the find_package call returns. "
"If the version is acceptable the following variables are set:\n"
" <package>_VERSION = full provided version string\n"
" <package>_VERSION_MAJOR = major version if provided, else 0\n"
" <package>_VERSION_MINOR = minor version if provided, else 0\n"
" <package>_VERSION_PATCH = patch version if provided, else 0\n"
" <package>_VERSION_TWEAK = tweak version if provided, else 0\n"
" <package>_VERSION_COUNT = number of version components, 0 to 4\n"
"and the corresponding package configuration file is loaded. "
"When multiple package configuration files are available whose version "
"files claim compatibility with the version requested it is unspecified "
"which one is chosen. "
"No attempt is made to choose a highest or closest version number."
"\n"
"Config mode provides an elaborate interface and search procedure. "
"Much of the interface is provided for completeness and for use "
"internally by find-modules loaded by Module mode. "
"Most user code should simply call\n"
" find_package(<package> [major[.minor]] [EXACT] [REQUIRED|QUIET])\n"
"in order to find a package. Package maintainers providing CMake "
"package configuration files are encouraged to name and install "
"them such that the procedure outlined below will find them "
"without requiring use of additional options."
"\n"
"CMake constructs a set of possible installation prefixes for the "
"package. Under each prefix several directories are searched for a "
"configuration file. The tables below show the directories searched. "
"Each entry is meant for installation trees following Windows (W), "
"UNIX (U), or Apple (A) conventions.\n"
" <prefix>/ (W)\n"
" <prefix>/(cmake|CMake)/ (W)\n"
" <prefix>/<name>*/ (W)\n"
" <prefix>/<name>*/(cmake|CMake)/ (W)\n"
" <prefix>/(lib/<arch>|lib|share)/cmake/<name>*/ (U)\n"
" <prefix>/(lib/<arch>|lib|share)/<name>*/ (U)\n"
" <prefix>/(lib/<arch>|lib|share)/<name>*/(cmake|CMake)/ (U)\n"
"On systems supporting OS X Frameworks and Application Bundles "
"the following directories are searched for frameworks or bundles "
"containing a configuration file:\n"
" <prefix>/<name>.framework/Resources/ (A)\n"
" <prefix>/<name>.framework/Resources/CMake/ (A)\n"
" <prefix>/<name>.framework/Versions/*/Resources/ (A)\n"
" <prefix>/<name>.framework/Versions/*/Resources/CMake/ (A)\n"
" <prefix>/<name>.app/Contents/Resources/ (A)\n"
" <prefix>/<name>.app/Contents/Resources/CMake/ (A)\n"
"In all cases the <name> is treated as case-insensitive and corresponds "
"to any of the names specified (<package> or names given by NAMES). "
"Paths with lib/<arch> are enabled if CMAKE_LIBRARY_ARCHITECTURE is set. "
"If PATH_SUFFIXES is specified the suffixes are appended to each "
"(W) or (U) directory entry one-by-one.\n"
"This set of directories is intended to work in cooperation with "
"projects that provide configuration files in their installation trees. "
"Directories above marked with (W) are intended for installations on "
"Windows where the prefix may point at the top of an application's "
"installation directory. Those marked with (U) are intended for "
"installations on UNIX platforms where the prefix is shared by "
"multiple packages. This is merely a convention, so all (W) and (U) "
"directories are still searched on all platforms. "
"Directories marked with (A) are intended for installations on "
"Apple platforms. The cmake variables CMAKE_FIND_FRAMEWORK and "
"CMAKE_FIND_APPBUNDLE determine the order of preference "
"as specified below.\n"
"The set of installation prefixes is constructed using the following "
"steps. If NO_DEFAULT_PATH is specified all NO_* options are enabled.\n"
"1. Search paths specified in cmake-specific cache variables. "
"These are intended to be used on the command line with a -DVAR=value. "
"This can be skipped if NO_CMAKE_PATH is passed.\n"
" CMAKE_PREFIX_PATH\n"
" CMAKE_FRAMEWORK_PATH\n"
" CMAKE_APPBUNDLE_PATH\n"
"2. Search paths specified in cmake-specific environment variables. "
"These are intended to be set in the user's shell configuration. "
"This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.\n"
" <package>_DIR\n"
" CMAKE_PREFIX_PATH\n"
" CMAKE_FRAMEWORK_PATH\n"
" CMAKE_APPBUNDLE_PATH\n"
"3. Search paths specified by the HINTS option. "
"These should be paths computed by system introspection, such as a "
"hint provided by the location of another item already found. "
"Hard-coded guesses should be specified with the PATHS option.\n"
"4. Search the standard system environment variables. "
"This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is passed. "
"Path entries ending in \"/bin\" or \"/sbin\" are automatically "
"converted to their parent directories.\n"
" PATH\n"
"5. Search project build trees recently configured in a CMake GUI. "
"This can be skipped if NO_CMAKE_BUILDS_PATH is passed. "
"It is intended for the case when a user is building multiple "
"dependent projects one after another.\n"
"6. Search paths stored in the CMake user package registry. "
"This can be skipped if NO_CMAKE_PACKAGE_REGISTRY is passed. "
"On Windows a <package> may appear under registry key\n"
" HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Packages\\<package>\n"
"as a REG_SZ value, with arbitrary name, that specifies the directory "
"containing the package configuration file. "
"On UNIX platforms a <package> may appear under the directory\n"
" ~/.cmake/packages/<package>\n"
"as a file, with arbitrary name, whose content specifies the directory "
"containing the package configuration file. "
"See the export(PACKAGE) command to create user package registry entries "
"for project build trees."
"\n"
"7. Search cmake variables defined in the Platform files "
"for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH "
"is passed.\n"
" CMAKE_SYSTEM_PREFIX_PATH\n"
" CMAKE_SYSTEM_FRAMEWORK_PATH\n"
" CMAKE_SYSTEM_APPBUNDLE_PATH\n"
"8. Search paths stored in the CMake system package registry. "
"This can be skipped if NO_CMAKE_SYSTEM_PACKAGE_REGISTRY is passed. "
"On Windows a <package> may appear under registry key\n"
" HKEY_LOCAL_MACHINE\\Software\\Kitware\\CMake\\Packages\\<package>\n"
"as a REG_SZ value, with arbitrary name, that specifies the directory "
"containing the package configuration file. "
"There is no system package registry on non-Windows platforms."
"\n"
"9. Search paths specified by the PATHS option. "
"These are typically hard-coded guesses.\n"
;
this->CommandDocumentation += this->GenericDocumentationMacPolicy;
this->CommandDocumentation += this->GenericDocumentationRootPath;
this->CommandDocumentation += this->GenericDocumentationPathsOrder;
this->CommandDocumentation +=
"\n"
"Every non-REQUIRED find_package() call can be disabled by setting the "
"variable CMAKE_DISABLE_FIND_PACKAGE_<package> to TRUE. See the "
"documentation for the CMAKE_DISABLE_FIND_PACKAGE_<package> variable for "
"more information.\n"
"When loading a find module or package configuration file find_package "
"defines variables to provide information about the call arguments "
"(and restores their original state before returning):\n"
" <package>_FIND_REQUIRED = true if REQUIRED option was given\n"
" <package>_FIND_QUIETLY = true if QUIET option was given\n"
" <package>_FIND_VERSION = full requested version string\n"
" <package>_FIND_VERSION_MAJOR = major version if requested, else 0\n"
" <package>_FIND_VERSION_MINOR = minor version if requested, else 0\n"
" <package>_FIND_VERSION_PATCH = patch version if requested, else 0\n"
" <package>_FIND_VERSION_TWEAK = tweak version if requested, else 0\n"
" <package>_FIND_VERSION_COUNT = number of version components, 0 to 4\n"
" <package>_FIND_VERSION_EXACT = true if EXACT option was given\n"
" <package>_FIND_COMPONENTS = list of requested components\n"
" <package>_FIND_REQUIRED_<c> = true if component <c> is required\n"
" false if component <c> is optional\n"
"In Module mode the loaded find module is responsible to honor the "
"request detailed by these variables; see the find module for details. "
"In Config mode find_package handles REQUIRED, QUIET, and version "
"options automatically but leaves it to the package configuration file "
"to handle components in a way that makes sense for the package. "
"The package configuration file may set <package>_FOUND to false "
"to tell find_package that component requirements are not satisfied."
"\n"
"See the cmake_policy() command documentation for discussion of the "
"NO_POLICY_SCOPE option."
;
}
//----------------------------------------------------------------------------
const char* cmFindPackageCommand::GetFullDocumentation() const
{
if(this->CommandDocumentation.empty())
{
const_cast<cmFindPackageCommand *>(this)->GenerateDocumentation();
}
return this->CommandDocumentation.c_str();
}
//----------------------------------------------------------------------------
bool cmFindPackageCommand
::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)

View File

@@ -51,22 +51,7 @@ public:
*/
virtual const char* GetName() const { return "find_package";}
/**
* Succinct documentation.
*/
virtual const char* GetTerseDocumentation() const
{
return "Load settings for an external project.";
}
/**
* More documentation.
*/
virtual const char* GetFullDocumentation() const;
cmTypeMacro(cmFindPackageCommand, cmFindCommon);
protected:
virtual void GenerateDocumentation();
private:
void AppendSuccessInformation();
void AppendToFoundProperty(bool found);
@@ -113,7 +98,6 @@ private:
struct OriginalDef { bool exists; std::string value; };
std::map<cmStdString, OriginalDef> OriginalDefs;
std::string CommandDocumentation;
cmStdString Name;
cmStdString Variable;
cmStdString Version;

View File

@@ -20,51 +20,6 @@ cmFindPathCommand::cmFindPathCommand()
this->IncludeFileInPath = false;
}
void cmFindPathCommand::GenerateDocumentation()
{
this->cmFindBase::GenerateDocumentation();
cmSystemTools::ReplaceString(this->GenericDocumentation,
"FIND_XXX", "find_path");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_XXX_PATH", "CMAKE_INCLUDE_PATH");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_XXX_MAC_PATH",
"CMAKE_FRAMEWORK_PATH");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_SYSTEM_XXX_MAC_PATH",
"CMAKE_SYSTEM_FRAMEWORK_PATH");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"XXX_SYSTEM", "INCLUDE");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_SYSTEM_XXX_PATH",
"CMAKE_SYSTEM_INCLUDE_PATH");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"SEARCH_XXX_DESC",
"directory containing the named file");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"SEARCH_XXX", "file in a directory");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"XXX_SUBDIR", "include");
cmSystemTools::ReplaceString(
this->GenericDocumentation,
"XXX_EXTRA_PREFIX_ENTRY",
" <prefix>/include/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and\n");
cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_FIND_ROOT_PATH_MODE_XXX",
"CMAKE_FIND_ROOT_PATH_MODE_INCLUDE");
if(!this->IncludeFileInPath)
{
this->GenericDocumentation +=
"\n"
"When searching for frameworks, if the file is specified as "
"A/b.h, then the framework search will look for "
"A.framework/Headers/b.h. "
"If that is found the path will be set to the path to the framework. "
"CMake will convert this to the correct -F option to include the "
"file. ";
}
}
// cmFindPathCommand
bool cmFindPathCommand
::InitialPass(std::vector<std::string> const& argsIn, cmExecutionStatus &)

Some files were not shown because too many files have changed in this diff Show More