Help: CMP0135 applies to FetchContent as well

This updates the CMP0135 documentation, which should have been
done as part of c2044fdf3f (FetchContent: Respect the CMP0135 policy
setting, 2022-06-02).

Issue: #23560
This commit is contained in:
Craig Scott
2024-04-27 11:01:45 +10:00
parent 301a26741d
commit 9b61a7147d
3 changed files with 12 additions and 12 deletions

View File

@@ -129,7 +129,7 @@ Policies Introduced by CMake 3.24
CMP0138: CheckIPOSupported uses flags from calling project. </policy/CMP0138>
CMP0137: try_compile() passes platform variables in project mode. </policy/CMP0137>
CMP0136: Watcom runtime library flags are selected by an abstraction. </policy/CMP0136>
CMP0135: ExternalProject ignores timestamps in archives by default for the URL download method. </policy/CMP0135>
CMP0135: ExternalProject and FetchContent ignore timestamps in archives by default for the URL download method. </policy/CMP0135>
CMP0134: Fallback to "HOST" Windows registry view when "TARGET" view is not usable. </policy/CMP0134>
CMP0133: The CPack module disables SLA by default in the CPack DragNDrop Generator. </policy/CMP0133>
CMP0132: Do not set compiler environment variables on first run. </policy/CMP0132>

View File

@@ -4,20 +4,20 @@ CMP0135
.. versionadded:: 3.24
When using the ``URL`` download method with the :command:`ExternalProject_Add`
command, CMake 3.23 and below sets the timestamps of the extracted contents
to the same as the timestamps in the archive. When the ``URL`` changes, the
new archive is downloaded and extracted, but the timestamps of the extracted
contents might not be newer than the previous contents. Anything that depends
on the extracted contents might not be rebuilt, even though the contents may
change.
or :command:`FetchContent_Declare` commands, CMake 3.23 and below sets the
timestamps of the extracted contents to the same as the timestamps in the
archive. When the ``URL`` changes, the new archive is downloaded and extracted,
but the timestamps of the extracted contents might not be newer than the
previous contents. Anything that depends on the extracted contents might not
be rebuilt, even though the contents may change.
CMake 3.24 and above prefers to set the timestamps of all extracted contents
to the time of the extraction. This ensures that anything that depends on the
extracted contents will be rebuilt whenever the ``URL`` changes.
The ``DOWNLOAD_EXTRACT_TIMESTAMP`` option to the
:command:`ExternalProject_Add` command can be used to explicitly specify how
timestamps should be handled. When ``DOWNLOAD_EXTRACT_TIMESTAMP`` is not
The ``DOWNLOAD_EXTRACT_TIMESTAMP`` option to the :command:`ExternalProject_Add`
and :command:`FetchContent_Declare` commands can be used to explicitly specify
how timestamps should be handled. When ``DOWNLOAD_EXTRACT_TIMESTAMP`` is not
given, this policy controls the default behavior. The ``OLD`` behavior for
this policy is to restore the timestamps from the archive. The ``NEW``
behavior sets the timestamps of extracted contents to the time of extraction.

View File

@@ -406,8 +406,8 @@ class cmMakefile;
"is not usable.", \
3, 24, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0135, \
"ExternalProject ignores timestamps in archives by default for the " \
"URL download method", \
"ExternalProject and FetchContent ignore timestamps in archives by " \
"default for the URL download method", \
3, 24, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0136, \
"Watcom runtime library flags are selected by an abstraction.", 3, \