80 Commits

Author SHA1 Message Date
Brad King
ed54d87789 Configure CMake itself with policies through CMake 3.15
In particular, set `CMP0091` to `NEW` to enable the MSVC runtime library
abstraction so it can be set via `CMAKE_MSVC_RUNTIME_LIBRARY` in the
cache.
2019-08-23 10:55:58 -04:00
Brad King
ecdf38aa36 CMakeVersion: Move computation logic to main script 2019-07-29 11:25:43 -04:00
Craig Scott
0518e675ea CMake.qch: Don't include the version in the file name
Fixes: #19374
2019-07-17 21:35:12 +10:00
Brad King
1069a3f02b Configure CMake itself with policies through CMake 3.14
In particular, set `CMP0082` to `NEW` to interleave install commands
in the top-level directory with subdirectory installations.
2019-05-08 13:18:30 -04:00
Brad King
748d024551 Merge topic 'fetchcontent-reduce-boilerplate'
a94355c7b7 FetchContent: Add new command FetchContent_MakeAvailable()
611d5274de Sphinx: Add limited support for nested variables in docs
1a07e1b47d FetchContent: Trivial doc corrections

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2830
2019-01-30 08:13:42 -05:00
Craig Scott
611d5274de Sphinx: Add limited support for nested variables in docs
This is needed to allow example code to contain content like
`${some_${foo}_bar}`.
2019-01-26 16:49:15 +11:00
Lucy Phipps
b9e6d04558 Reduce size of PNG images
Use FileOptimizer 13.50.2431 (x86) and ZopfliPNG 1.0.2.

Update expected file hashes in tests.
2019-01-25 09:14:51 -05:00
Robert Maynard
db89590f36 Help: CMakeTemplateStyle uses colors that better contrast. 2019-01-09 15:53:26 -05:00
Brad King
29ec12fb4f Merge topic 'cmake-through-3.12'
95b4b9137a Declare support for CMake versions through 3.12 for own build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2496
2018-10-19 09:58:27 -04:00
Joachim Wuttke (o)
fc7ee1ca45 Help: Override pygments CMakeLexer to support <..> and [..]
* The code snippets in the docs consist of CMake code mixed
  with syntax definition punctuation like < > [ ] ... Therefore
  a pure CMake lexer is inadequate. Here it is replaced by a
  CMake syntax definition parser.
* Fixed syntax definition snippets in FindPkgConfig.cmake to
  make best use of syntax highlighting. This source file is the
  hardest to support because it contains comparison operators
  <= = >=, which need special attention to avoid confusion
  with the placeholder indicators <...>.
* Fixed syntax in execute_process.rst (there were unbalanced
  brackets).
* Disabled syntax highlighting for long string examples in
  cmake-language.7.rst.
* No highlighting of removed syntax in CMP0049
* To inspect the outcome of this patch, see e.g. the pages
  * manual/cmake-buildsystem.7.html
  * module/ExternalProject.html
  * module/FindPkgConfig.html
  which are particularly rich in complex code snippets.
2018-10-19 07:25:34 +11:00
Brad King
95b4b9137a Declare support for CMake versions through 3.12 for own build
CMake 3.12 introduced a `...<max>` syntax in the version given to
`cmake_minimum_required` to automatically set policies to NEW up
to that version.  Use it to avoid listing policies explicitly.

The syntax is compatible with older versions of CMake such that they use
the extended version string for the `CMAKE_MINIMUM_REQUIRED_VERSION`
variable (which we don't use) but otherwise ignore it.
2018-10-17 14:29:16 -04:00
T.J. Corona
66f59bd7da cmake-gui: Update icons 2018-08-16 11:56:08 -04:00
Kyle Edwards
2a2829cc75 Help: Add new section for CPack generators
The documentation for CPack generators previously lived in their
respective internal CMake modules. This setup was misleading,
because it implied that you should include the modules in your own
code, which is not the case. Moving the documentation into a
separate section does a better job of hiding the internal modules,
which are just an implementation detail. The generator documentation
has also been modified to remove any references to the module name.

The CPackIFW module is a special exception: since it has user-facing
macros, the documentation for these macros has been kept in the module
page, while all other documentation related to the IFW generator has
been moved into the new section.

To make it easier to find the new documentation, the old help pages
for the CPack*.cmake modules have not been deleted, but have been
replaced with a link to their respective help page in the new
documentation section.
2018-06-21 11:00:25 -04:00
Orivej Desh
276e369813 Utilities/Sphinx: Add option to build and install Info manual
Add option `SPHINX_INFO` to enable the Sphinx 'texinfo' builder and use
the `makeinfo` tool to convert it to a `.info` file.
2018-06-12 10:25:37 -04:00
luz.paz
be28106880 Fix misc. typos
Found via `codespell` and `grep`
2018-06-04 10:32:49 -04:00
Brad King
d165fd1727 Merge topic 'doc-code-block-highlight'
8114b00b02 Utilities/Sphinx: Do not highlight unspecified code blocks as python

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2047
2018-05-08 08:28:19 -04:00
Brad King
72814e46da Utilities/Sphinx: Make HTML links in parsed-literal blocks more obvious
Hyperlink text color does not stand out when used inside a literal block
because such blocks typically get syntax highlighting.  Update our CSS
style to make the links more distinct.

Suggested-by: Kyle Edwards <kyle.edwards@kitware.com>
2018-05-07 10:10:37 -04:00
Brad King
8114b00b02 Utilities/Sphinx: Do not highlight unspecified code blocks as python 2018-05-04 14:57:36 -04:00
Brad King
8acf46caf1 Utilities/Sphinx: Add role and directive for 'envvar' in CMake domain
This enables cross-reference syntax for CMake environment variables:

    :envvar:`SOMEVAR`

and definition of CMake environment variables via a directive:

    .. envvar:: SOMEVAR

It also adds environment variables defined by the directive and by
`Help/envvar/SOMEVAR.rst` documents to the index.

This `envvar` role and directive is defined in our `cmake` domain
and overrides the equivalent `envvar` role and directive provided
by Sphinx in its default domain.  This is okay because we build
CMake documents in the `cmakd` domain.

This follows up the work from commit v3.10.0-rc1~43^2 (Help: Document
CMake's environment variables, 2017-09-01) that originally added
`envvar` documentation.
2018-04-19 09:02:44 -04:00
Brad King
7e532abc78 Utilities/Sphinx: Fix QtHelp generator identifiers
Add missinge entry in `create_identifiers.py` helper.
2018-04-19 08:48:28 -04:00
Brad King
fb0c3c564c Require CMake 3.1 to build CMake itself
This simplifies some policy settings and use of third-party
libraries with imported targets.
2017-08-10 15:08:02 -04:00
Björn Esser
2a68ff7fd7 Utilities/Sphinx: Restore compatibility with Sphinx pre-1.2
Since commit v3.8.0-rc2~28^2~2 (Utilities/Sphinx: Port cmake extension
to Sphinx 1.4, 2017-02-09) we use the `sphinx.version_info` tuple.
However, it was added in Sphinx v1.2 so the check breaks compatibility
with older versions.  Revise our check to assume Sphinx pre-1.2 if the
version tuple does not exist.
2017-08-02 11:25:21 -04:00
Brad King
c273906f48 Utilities/Sphinx: Build documentation independently by default
Previously we made the `documentation` target depend on the executable
targets.  There is no real reason to do this other than serializing the
documentation build output in terminals.  Move this dependency behind an
undocumented option so that it is not on by default.
2017-05-01 13:18:25 -04:00
Matthew Woehlke
62b85c9406 Utilities/Sphinx: Use brighter colors for html theme
Set Sphinx `html_theme_options` to give the generated documentation a
brighter and softer look than the default colors.
2017-03-28 13:38:42 -04:00
Brad King
d33de80c8a Help/dev: Exclude this directory from user-facing documentation
Teach Sphinx and our own install rules to skip a `Help/dev` directory.
This will give us a place to put developer-only documentation that
should not be included in the user-facing documentation.  Add a
placeholder README.
2017-03-01 16:05:55 -05:00
Brad King
46c6489850 Merge topic 'sphinx-1.4'
30abf145 Help: Fix cmake code block warnings produced by Sphinx 1.4
97917900 Utilities/Sphinx: Port qthelp css workaround to Sphinx 1.4
971384c2 Utilities/Sphinx: Port cmake extension to Sphinx 1.4
2017-02-10 11:32:21 -05:00
Brad King
97917900d1 Utilities/Sphinx: Port qthelp css workaround to Sphinx 1.4
The `default.css` static content is no longer placed in the qthelp
`_static` directory.  If it does not exist, skip over it and insert
the content of `basic.css` directly into `cmake.css`.
2017-02-10 10:43:29 -05:00
Gregor Jasny
971384c287 Utilities/Sphinx: Port cmake extension to Sphinx 1.4
Sphinx 1.4 introduced a breaking change to `indexnode` by changing
the length of a tuple.  Teach our extension to produce a tuple of
the proper length for the version of Sphinx in use.

This gets rid of the "4 column based index found" warning.
2017-02-10 10:24:25 -05:00
Brad King
82e5ab9e14 Utilities/Sphinx: Add option for cmake.org version switch to html
Leave the option undocumented since it is not for general use.  We can
simply pass it through `SPHINX_FLAGS` when building for publication on
`cmake.org`.
2017-02-08 08:19:10 -05:00
Brad King
86578eccf2 Simplify CMake per-source license notices
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.
2016-09-27 15:14:44 -04:00
Brad King
ae783c9ba9 Require CMake 2.8.12.2 to build CMake itself
This will enable use of features such as ALIAS targets within CMake's
own build.
2016-09-15 09:24:25 -04:00
Konstantin Podsvirov
7d7446c905 Utilities/Sphinx: Remove use of continue() method
We currently only require CMake 2.8.4 which does not provide it.
2016-08-02 15:15:00 -04:00
Brad King
8282547e0f Install ccmake.1 and cmake-gui.1 conditionally with their tools (#15957) 2016-02-08 09:38:18 -05:00
Brad King
da7276cf94 Replace http://www.cmake.org URLs with https://cmake.org
The latter is now the preferred URL for visiting cmake.org with a
browser.  Convert using the shell code:

 git ls-files -z | xargs -0 sed -i 's|http://www\.cmake|https://cmake|g'
2015-09-25 15:47:39 -04:00
Brad King
9ce7a663d6 Utilities/Sphinx: Add CMake_OPTIONAL_COMPONENT macro
When building this directory independently define the macro since we
will not get the definition from the top level of the source tree.
2015-07-07 09:38:48 -04:00
Konstantin Podsvirov
c823f04e0c CMake: New option CMake_INSTALL_COMPONENTS
By default is OFF.
Now it's used with CPack IFW himself installer.
2015-07-07 09:16:40 -04:00
Konstantin Podsvirov
7383e4d722 CMake: Install COMPONENTs (sphinx-man)
Added component sphinx-man
2015-07-07 08:11:10 +03:00
Konstantin Podsvirov
938bbc4352 CMake: Install COMPONENTs
Added components:
- cmake
- ctest
- cpack
- cmake-gui
- ccmake
- data
- sphinx-html
- sphinx-singlehtml
- sphinx-qthelp

Other now Unspecified.
2015-07-07 08:11:09 +03:00
Brad King
dd107b30d2 Add option to pass custom flags to sphinx-build (#15545)
Create a SPHINX_FLAGS cache entry that users can populate with
command-line flags for sphinx-build.  Add an option to the
bootstrap script to populate it up front.

Suggested-by: Felix Geyer <debfx@ubuntu.com>
2015-04-30 09:41:31 -04:00
Gregor Jasny
840f5b89a4 Help: Install Sphinx HTML object mapping file
To link CMake documentation from other documentation sets
like KDE extra-cmake-modules the intersphinx extension depends
on the objects.inv mapping file. The size overhead of 14k seems
to be neglectable.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2015-03-22 11:50:53 +01:00
Brad King
13fc2ed4c4 Merge topic 'doc-mixed-case-commands'
607b39dc Utilities/Sphinx: Fix link targets for mixed-case command names
2014-12-04 10:15:10 -05:00
Brad King
607b39dc11 Utilities/Sphinx: Fix link targets for mixed-case command names
When a CMake domain 'command' object is defined by CMakeTransform or the
'cmake:command' directive, generate the link target with a lower-case
name even if the command name is not all lower-case.  This is needed to
make cross-references to the command definition work since the
'cmake:command' role is marked with the 'lowercase' property.
2014-12-04 10:03:26 -05:00
Brad King
397c762da4 Merge topic 'doc-sphinx-cmake-fixup'
5cda2205 Utilities/Sphinx: Add missing call to note_explicit_target
2014-11-18 09:12:25 -05:00
Brad King
5cda220548 Utilities/Sphinx: Add missing call to note_explicit_target
Sphinx calls document.note_explicit_target with any nodes.target() it
creates.  Add such a call when we create a document target in
CMakeTransform.
2014-11-17 15:37:31 -05:00
Brad King
b4f5204097 Merge topic 'doc-index-xrefs'
7ca9a459 Utilities/Sphinx: Add index entries for cross-references
2014-11-12 09:35:45 -05:00
Brad King
7ca9a459eb Utilities/Sphinx: Add index entries for cross-references
Add a document transform to insert index and target nodes just before
any CMake domain cross-reference node.  This will make references to
CMake domain objects appear in the index.  Also add a comment explaining
why it cannot be done in a result_nodes method of the CMakeXRefRole.
2014-11-12 09:10:52 -05:00
Brad King
4c8c442d7c Help: Fix broken cross-references reported by 'nitpicky' option
Enable the Sphinx 'nitpicky' option and fix the resulting warnings about
dangling references.
2014-11-07 11:41:21 -05:00
Brad King
5088e0a048 Utilities/Sphinx: Fix html_favicon configuration
The value must be either a full path or relative to the configuration
directory, not relative to the 'static' directory.  Use a full path.
This avoids a warning:

 WARNING: favicon file 'cmake-favicon.ico' does not exist

It worked before because all 'static' directory content is copied to the
'_static' directory of html output anyway.
2014-11-07 09:50:50 -05:00
Nils Gladitz
9e5e7e71c5 Help: Fix QtHelp commands on Windows
Explicitly invoke python script through the interpreter since
windows does not act on hashbangs.
Use the found qcollectiongenerator executable rather than what
happens to be in PATH.
2014-07-28 21:07:53 +02:00
Stephen Kelly
376ba93588 Help: Identify more artifact types in QtHelp documentation.
Add identifiers for variables, properties, policies and modules.
This will allow QtCreator to show relevant documentation if it learns
more about the context of the contents of cmake files.
2014-07-17 16:05:10 +02:00