From 9b61a7147db0532c92d4f17f1eb7616b40f93ee8 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Sat, 27 Apr 2024 11:01:45 +1000 Subject: 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 --- Help/manual/cmake-policies.7.rst | 2 +- Help/policy/CMP0135.rst | 18 +++++++++--------- Source/cmPolicies.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 51b4ce6..e46e88e 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -129,7 +129,7 @@ Policies Introduced by CMake 3.24 CMP0138: CheckIPOSupported uses flags from calling project. CMP0137: try_compile() passes platform variables in project mode. CMP0136: Watcom runtime library flags are selected by an abstraction. - CMP0135: ExternalProject ignores timestamps in archives by default for the URL download method. + CMP0135: ExternalProject and FetchContent ignore timestamps in archives by default for the URL download method. CMP0134: Fallback to "HOST" Windows registry view when "TARGET" view is not usable. CMP0133: The CPack module disables SLA by default in the CPack DragNDrop Generator. CMP0132: Do not set compiler environment variables on first run. diff --git a/Help/policy/CMP0135.rst b/Help/policy/CMP0135.rst index c8d9205..09c688d 100644 --- a/Help/policy/CMP0135.rst +++ b/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. diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index b0237d7..ada87dd 100644 --- a/Source/cmPolicies.h +++ b/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, \ -- cgit v0.12