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/policy | |
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/policy')
-rw-r--r-- | Help/policy/CMP0170.rst | 30 |
1 files changed, 30 insertions, 0 deletions
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 |