Merge topic 'fetchcontent-CMAKE-vars-passthrough'

1851aa49be FetchContent: Pass through networking-related CMAKE_... variables
96937438b7 Help: Clean up how TLS and NETRC variables are discussed
2a82bd85b6 Help: Add documentation for CMAKE_TLS_CAINFO

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6589
This commit is contained in:
Craig Scott
2021-10-06 11:07:12 +00:00
committed by Kitware Robot
11 changed files with 108 additions and 30 deletions

View File

@@ -1073,7 +1073,7 @@ Options to both ``DOWNLOAD`` and ``UPLOAD`` are:
.. versionadded:: 3.11
Specify whether the .netrc file is to be used for operation. If this
option is not specified, the value of the ``CMAKE_NETRC`` variable
option is not specified, the value of the :variable:`CMAKE_NETRC` variable
will be used instead.
Valid levels are:
@@ -1092,29 +1092,28 @@ Options to both ``DOWNLOAD`` and ``UPLOAD`` are:
Specify an alternative .netrc file to the one in your home directory,
if the ``NETRC`` level is ``OPTIONAL`` or ``REQUIRED``. If this option
is not specified, the value of the ``CMAKE_NETRC_FILE`` variable will
is not specified, the value of the :variable:`CMAKE_NETRC_FILE` variable will
be used instead.
If neither ``NETRC`` option is given CMake will check variables
``CMAKE_NETRC`` and ``CMAKE_NETRC_FILE``, respectively.
``TLS_VERIFY <ON|OFF>``
Specify whether to verify the server certificate for ``https://`` URLs.
The default is to *not* verify.
The default is to *not* verify. If this option is not specified, the value
of the :variable:`CMAKE_TLS_VERIFY` variable will be used instead.
.. versionadded:: 3.18
Added support to ``file(UPLOAD)``.
``TLS_CAINFO <file>``
Specify a custom Certificate Authority file for ``https://`` URLs.
Specify a custom Certificate Authority file for ``https://`` URLs. If this
option is not specified, the value of the :variable:`CMAKE_TLS_CAINFO`
variable will be used instead.
.. versionadded:: 3.18
Added support to ``file(UPLOAD)``.
For ``https://`` URLs CMake must be built with OpenSSL support. ``TLS/SSL``
certificates are not checked by default. Set ``TLS_VERIFY`` to ``ON`` to
check certificates. If neither ``TLS`` option is given CMake will check
variables :variable:`CMAKE_TLS_VERIFY` and ``CMAKE_TLS_CAINFO``, respectively.
check certificates.
Additional options to ``DOWNLOAD`` are:

View File

@@ -247,6 +247,7 @@ Variables that Change Behavior
/variable/CMAKE_SYSTEM_LIBRARY_PATH
/variable/CMAKE_SYSTEM_PREFIX_PATH
/variable/CMAKE_SYSTEM_PROGRAM_PATH
/variable/CMAKE_TLS_CAINFO
/variable/CMAKE_TLS_VERIFY
/variable/CMAKE_USER_MAKE_RULES_OVERRIDE
/variable/CMAKE_WARN_DEPRECATED

View File

@@ -0,0 +1,8 @@
fetchcontent-CMAKE-vars-passthrough.rst
---------------------------------------
* The :module:`FetchContent` module now passes through the
:variable:`CMAKE_TLS_VERIFY`, :variable:`CMAKE_TLS_CAINFO`,
:variable:`CMAKE_NETRC` and :variable:`CMAKE_NETRC_FILE` variables (when
defined) to the underlying :module:`ExternalProject` sub-build.
Previously, those variables were silently ignored by :module:`FetchContent`.

View File

@@ -3,9 +3,11 @@ CMAKE_NETRC
.. versionadded:: 3.11
This variable is used to initialize the ``NETRC`` option for
:command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands and the
module :module:`ExternalProject`. See those commands for additional
information.
This variable is used to initialize the ``NETRC`` option for the
:command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands.
See those commands for additional information.
This variable is also used by the :module:`ExternalProject` and
:module:`FetchContent` modules for internal calls to :command:`file(DOWNLOAD)`.
The local option takes precedence over this variable.

View File

@@ -3,9 +3,11 @@ CMAKE_NETRC_FILE
.. versionadded:: 3.11
This variable is used to initialize the ``NETRC_FILE`` option for
:command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands and the
module :module:`ExternalProject`. See those commands for additional
information.
This variable is used to initialize the ``NETRC_FILE`` option for the
:command:`file(DOWNLOAD)` and :command:`file(UPLOAD)` commands.
See those commands for additional information.
This variable is also used by the :module:`ExternalProject` and
:module:`FetchContent` modules for internal calls to :command:`file(DOWNLOAD)`.
The local option takes precedence over this variable.

View File

@@ -0,0 +1,9 @@
CMAKE_TLS_CAINFO
----------------
Specify the default value for the :command:`file(DOWNLOAD)` and
:command:`file(UPLOAD)` commands' ``TLS_CAINFO`` options.
It is unset by default.
This variable is also used by the :module:`ExternalProject` and
:module:`FetchContent` modules for internal calls to :command:`file(DOWNLOAD)`.

View File

@@ -5,8 +5,8 @@ Specify the default value for the :command:`file(DOWNLOAD)` and
:command:`file(UPLOAD)` commands' ``TLS_VERIFY`` options.
If not set, the default is *off*.
This setting is also used by the :module:`ExternalProject` module
for internal calls to :command:`file(DOWNLOAD)`.
This variable is also used by the :module:`ExternalProject` and
:module:`FetchContent` modules for internal calls to :command:`file(DOWNLOAD)`.
TLS verification can help provide confidence that one is connecting
to the desired server. When downloading known content, one should