diff options
author | Craig Scott <craig.scott@crascit.com> | 2024-05-28 12:56:25 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2024-05-29 10:39:17 (GMT) |
commit | f588421b58f23b192670ad686e2797a09489a096 (patch) | |
tree | cbf003f0f9ddcb6aa049081ba238e43607b67825 /Help | |
parent | 4370fcf7505bf0dc651478ab581f19c474278c59 (diff) | |
download | CMake-f588421b58f23b192670ad686e2797a09489a096.zip CMake-f588421b58f23b192670ad686e2797a09489a096.tar.gz CMake-f588421b58f23b192670ad686e2797a09489a096.tar.bz2 |
FetchContent: Enforce FETCHCONTENT_FULLY_DISCONNECTED requirements
FETCHCONTENT_FULLY_DISCONNECTED should only be set to true if
each dependency's source directory has already been populated.
Previously, this wasn't being checked, but now it is (subject to a new
policy).
Diffstat (limited to 'Help')
-rw-r--r-- | Help/manual/cmake-policies.7.rst | 1 | ||||
-rw-r--r-- | Help/policy/CMP0170.rst | 30 | ||||
-rw-r--r-- | Help/release/dev/enforce-fc-fully-disconnected-requirements.rst | 9 |
3 files changed, 40 insertions, 0 deletions
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 7d2440e..7155404 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -57,6 +57,7 @@ Policies Introduced by CMake 3.30 .. toctree:: :maxdepth: 1 + CMP0170: FETCHCONTENT_FULLY_DISCONNECTED requirements are enforced. </policy/CMP0170> CMP0169: FetchContent_Populate(depName) single-argument signature is deprecated. </policy/CMP0169> CMP0168: FetchContent implements steps directly instead of through a sub-build. </policy/CMP0168> CMP0167: The FindBoost module is removed. </policy/CMP0167> diff --git a/Help/policy/CMP0170.rst b/Help/policy/CMP0170.rst new file mode 100644 index 0000000..9d7860a --- /dev/null +++ b/Help/policy/CMP0170.rst @@ -0,0 +1,30 @@ +CMP0170 +------- + +.. versionadded:: 3.30 + +When ``FETCHCONTENT_FULLY_DISCONNECTED`` is set to true, +:command:`FetchContent_MakeAvailable` and :command:`FetchContent_Populate` +enforce the constraint that their source directory must already be populated. +The requirement has always been documented, but it was not checked or enforced +with CMake 3.29 or older. This sometimes led to hard-to-trace errors when a +project expected a dependency to have been populated, but its population was +silently skipped. + +CMake 3.30 and above prefers to check and enforce the constraint. +This policy provides compatibility for situations where the user cannot easily +prevent ``FETCHCONTENT_FULLY_DISCONNECTED`` from being inappropriately set +to true. + +The ``OLD`` behavior of this policy allows ``FETCHCONTENT_FULLY_DISCONNECTED`` +to be set to true even if a dependency's source directory has not been +populated. +The ``NEW`` behavior halts with a fatal error if +``FETCHCONTENT_FULLY_DISCONNECTED`` is set to true and a dependency population +would be skipped, but that dependency's source directory doesn't exist. + +.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30 +.. |WARNS_OR_DOES_NOT_WARN| replace:: warns +.. include:: STANDARD_ADVICE.txt + +.. include:: DEPRECATED.txt diff --git a/Help/release/dev/enforce-fc-fully-disconnected-requirements.rst b/Help/release/dev/enforce-fc-fully-disconnected-requirements.rst new file mode 100644 index 0000000..2db759c --- /dev/null +++ b/Help/release/dev/enforce-fc-fully-disconnected-requirements.rst @@ -0,0 +1,9 @@ +enforce-fc-fully-disconnected-requirements +------------------------------------------ + +* When :variable:`FETCHCONTENT_FULLY_DISCONNECTED` is set to true, + :command:`FetchContent_MakeAvailable` and the single-argument form of + :command:`FetchContent_Populate` require that the dependency's source + directory has already been populated. CMake 3.29 and earlier did not + check this requirement, but it is now enforced, subject to policy + :policy:`CMP0170`. |