Browse Source

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
Craig Scott 1 year ago
parent
commit
9b61a7147d
3 changed files with 12 additions and 12 deletions
  1. 1 1
      Help/manual/cmake-policies.7.rst
  2. 9 9
      Help/policy/CMP0135.rst
  3. 2 2
      Source/cmPolicies.h

+ 1 - 1
Help/manual/cmake-policies.7.rst

@@ -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>

+ 9 - 9
Help/policy/CMP0135.rst

@@ -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.

+ 2 - 2
Source/cmPolicies.h

@@ -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,   \