Merge topic 'enforce-fc-fully-disconnected-requirements'

f588421b58 FetchContent: Enforce FETCHCONTENT_FULLY_DISCONNECTED requirements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9556
This commit is contained in:
Brad King
2024-05-30 14:13:05 +00:00
committed by Kitware Robot
18 changed files with 178 additions and 6 deletions
+1
View File
@@ -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>
+30
View File
@@ -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
@@ -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`.