summaryrefslogtreecommitdiffstats
path: root/Source/cmDocumentation.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmDocumentation: use ofstream local variableDaniel Pfeifer2017-04-261-13/+4
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-2/+2
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* surround macro arguments with parenthesesDaniel Pfeifer2016-09-051-1/+1
|
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-4/+5
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-2/+1
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-8/+8
|
* Remove redundant arguments from fstream constructorsDaniel Pfeifer2016-06-141-1/+1
| | | | Don't pass the default value of the openmode parameter explicitly.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-371/+228
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-45/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Isolate formatted streaming blocks with clang-format off/onBrad King2016-05-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clang-format tool can do a good job formatting most code, but well-organized streaming blocks are best left manually formatted. Find blocks of the form os << "...\n" "...\n" ; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}' Find blocks of the form os << "...\n" << "...\n" << "...\n"; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}' Surround such blocks with the pair /* clang-format off */ ... /* clang-format on */ in order to protect them from update by clang-format. Use the C-style `/*...*/` comments instead of C++-style `//...` comments in order to prevent them from ever being swallowed by re-formatting of surrounding comments.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* cmake: Provide guidance when an invalid -G option is givenGerald Combs2015-04-101-0/+15
| | | | | | | Print a list of generators if no generator or an invalid one is supplied. Signed-off-by: Gerald Combs <gerald@wireshark.org>
* Include cmAlgorithms where it is used.Stephen Kelly2015-03-101-0/+1
|
* Replace 'foo.length() > 0' pattern with !foo.empty().Stephen Kelly2015-01-181-2/+2
|
* Use the cmDeleteAll algorithm instead of trivial raw loops.Stephen Kelly2015-01-131-6/+1
|
* cmake,ccmake: Produce shorter output on no arguments (#14973)Adam Strzelecki2014-06-131-3/+17
| | | | | | | | | | | | Instead printing complete help cmake/ccmake now prints only Usage section and extra information how to get more help or start your build. Implementation Details: Usage help type was renamed to Help, and new Usage was introduces that prints only command line usage information without any extra details. Commands add some extra information when no arguments are passed.
* Merge topic 'cmake-credits'Brad King2014-06-031-1/+1
|\ | | | | | | | | 889f2fd8 Simplify and clarify credit text and link
| * Simplify and clarify credit text and linkBrad King2014-06-031-1/+1
| | | | | | | | | | Use the name "Kitware" rather than "Kitware, Inc." to simplify the text. Provide a CMake-specific URL.
* | Merge topic 'doc-full-help'Brad King2014-04-291-2/+12
|\ \ | |/ | | | | | | 478356e6 Restore --help-full option to output all help manuals
| * Restore --help-full option to output all help manualsBrad King2014-04-251-2/+12
| | | | | | | | | | | | This option was removed during conversion to the reStructuredText documentation. Restore it. Process documentation starting at Help/index.rst so that all manuals are included in the output.
* | Remove c_str calls when using stream APIs.Stephen Kelly2014-03-111-6/+6
| | | | | | | | | | Use an ad-hoc clang tool for matching the calls which should be ported.
* | Remove some c_str() calls.Stephen Kelly2014-03-111-1/+1
| | | | | | | | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* | stringapi: Use strings for documentation namesBen Boeckel2014-03-081-2/+2
|/
* cmake: Implement placeholder --help-custom-modules compatibilityBrad King2014-01-081-1/+56
| | | | | | | | | | The implementation of the "cmake --help-custom-modules" was removed along with the rest of the old help generation infrastructure when documentation was converted to reStructuredText. In order to avoid breaking existing project builds outright when they use a custom command that runs a command like "cmake --help-custom-modules foo.1", generate the requested file with placeholder content explaining that the option is not supported anymore.
* Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-3/+4
| | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* Merge topic 'cmake-credits'Brad King2013-11-211-2/+6
|\ | | | | | | | | 6fc4ab9 Credit Kitware and csimsoft for their maintenance roles
| * Credit Kitware and csimsoft for their maintenance rolesBrad King2013-11-191-2/+6
| | | | | | | | | | Add maintenance credit to command-line "--version" output and the cmake-gui "About" dialog.
* | cmDocumentation: Fix exit after help output format warningsBrad King2013-11-191-12/+15
|/ | | | | | | | After warning that a help output format is no longer supported, fix the return value from cmDocumentation::CheckOptions to indicate that it was still a help option that was parsed. Otherwise CMake moves on to treat the help output file name as a source tree and complains that it does not exist.
* Refactor internal resource location APIs and initializationBrad King2013-11-121-2/+3
| | | | | | | | | | | | | | | | | | | | Rename cmSystemTools::FindExecutableDirectory to FindCMakeResources. Teach it to compute the locations of cmake, ctest, cpack, ccmake, and cmake-gui executables, and the location of CMAKE_ROOT. Provide this information from static cmSystemTools::Get<resource>() methods. Refactor code that needs these locations to use the new APIs. Teach FindCMakeResources to use the OS X system API to lookup the executable location. When running from the CMake build tree itself, leave a file in the tree that FindCMakeResources can use to read the location of the source tree. This avoids the need to compile the source tree location into a binary that may be installed and used without the source tree. Teach the QtDialog on OS X to create a "cmake-gui" symlink in the build tree next to "cmake" and the other tools, as is already done in the install tree for the application bundle. This ensures a consistent set of executables are available in one directory.
* Make --help-* options available from all command-line toolsBrad King2013-10-161-6/+38
| | | | | | | | | | | Make the standard --help-* options available from all command-line tools. Drop options that are no longer supported: --copyright, --help-full, --help-html, --help-man, --help-compatcommands, --help-custom-modules De-duplicate Help/manual/*.1.rst help options by using an OPTIONS_HELP.txt file included from each manual.
* Drop the 'Full' field from cmDocumentationEntryBrad King2013-10-161-27/+15
| | | | | We need only 'Brief' for usage documentation. We no longer have builtin 'Full' documentation, which is now in Help/*/*.rst files.
* Drop all documentation formatters except UsageBrad King2013-10-161-124/+37
| | | | | | | | We now need only the Usage formatter to support command-line options that print basic usage, and the supporting indented=>preformatted markup processor to support CMake message formatting. Drop all other documentation formatters and move the remaining code up into the top cmDocumentationFormatter class.
* Teach --help-* options to load documentation from .rst filesBrad King2013-10-161-32/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Install the Help directory next to Modules to make it available in CMake distributions. Use cmRST to read Help .rst documents and print them as help output. Add options --help-manual-list --help-manual to list available manuals or print one of them. Implement the options --help-commands --help-modules --help-policies --help-properties --help-variables by mapping to the corresponding manual page. Implement the options --help-command-list --help-module-list --help-policy-list --help-property-list --help-variable-list by globbing the available Help .rst documents of the corresponding type and reading their titles. Implement the options --help-command --help-module --help-policy --help-property --help-variable by globbing the matching Help .rst document(s) and printing them.
* Drop "full" documentation output typesBrad King2013-10-151-992/+17
| | | | | | | | | | | | | | | | We will no longer support full documentation generation from executables and will instead generate documentation with other tools. Disable (with a warning left behind) the command-line options: --copyright --help-compatcommands --help-full --help-html --help-man Drop supporting code. Drop manual sections generation from executables. Remove internal documentation construction APIs. Drop unused sections See Also, Author, Copyright, Compat Commands, Custom Modules.
* Add reStructuredText (RST) documentation formatterBrad King2013-10-151-0/+8
| | | | | | | | | | | | | | | | | | | | Temporarily add a RST formatter to convert builtin documentation to .rst source files. This will be removed shortly after we use it to convert documentation. Teach the RST formatter to: * Output preformatted blocks as reStructuredText "::" literal blocks. * Output option lists as bullet lists with option names enclosed in reStructuredText ``literal`` quoting. * Output individual documentation objects (commands, variables, etc.) in separate .rst files organized in directories by type. Replace references to cmVersion::GetCMakeVersion() in builtin documentation with the literal placeholder "|release|" that will be defined as a substitution later.
* Drop CPack module documentation markup extractionBrad King2013-10-151-327/+0
| | | | This will be replaced by alternative markup later.
* cmDocumentation: Drop version output from usage and text helpBrad King2013-10-151-8/+1
| | | | | Drop the "cmake version ..." line from the top of usage and text help formats. Print it only when requested with --version or similar option.
* cmake: Add --help-policy-list optionBrad King2013-10-151-0/+9
| | | | | All the other --help-<item> options have a corresponding option --help-<item>-list. Add one for --help-policy.
* Merge topic 'minor_cleanup'Brad King2013-10-071-2/+2
|\ | | | | | | | | | | | | | | 6931999 VS6: Add some delimiting between error message and content. d1a5f12 cmTarget: Fix typo in comment. 961c0ba Fix comments to match the code. 7cca50c Remove unused include.
| * Fix comments to match the code.Stephen Kelly2013-09-111-2/+2
| |
* | remove unused local typedefRolf Eike Beer2013-08-141-2/+2
|/ | | | | | | | Fixes this warning from g++ 4.8: CMake/Source/cmDocumentation.cxx:835:23: warning: typedef 'sdoc_t' locally defined but not used [-Wunused-local-typedefs] SDOC_UNKNOWN} sdoc_t; ^
* Fix spelling and typos (affecting binary data / module messages)Andreas Mohr2013-05-071-2/+2
|
* Update programmatically-reported copyright year (#13638)Brad King2012-11-051-1/+1
| | | | | Update the copyright year reported by 'bootstrap' and in the generated documentation to report 2012.
* docbook: Remove redundant docs that cause invalid DocBookDaniel Pfeifer2012-09-081-7/+0
| | | | | | If a subsection with a title is added, all subsequent subsections need a title too. The "helpful links" just repeat preceding subsections anyway.
* man documentation: detect man section from the given filenameAlex Neundorf2012-06-211-14/+33
| | | | | | | E.g. if you say cmake --help-custom-modules mymodules.7 cmake will now put section 7 into the generated manpage. Alex
* documentation: preparation for making the man section configurableAlex Neundorf2012-06-211-5/+6
| | | | | | | | This patch adds a man section number, which is then used by the DocumentationFormatterMan. The section number is right now always 1, detecting this from the file name will be the next step. Alex
* Try to fix compile error on Win32-vs70Eric NOULARD2012-02-181-3/+4
|
* Suppress unecessary (now empty) doc sectionsEric NOULARD2012-02-181-2/+0
|
* Dynamically add documentation section specified in documented script.Eric NOULARD2012-02-181-3/+18
| | | | Modify CPackDeb and CPackRPM as an example