CMP0170 — CMake 3.31.6 Documentation

# CMP0170

New in version 3.30.

When `FETCHCONTENT_FULLY_DISCONNECTED` is set to true, `FetchContent_MakeAvailable()` and `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.

This policy was introduced in CMake version 3.30. It may be set by `cmake_policy()` or `cmake_minimum_required()`. If it is not set, CMake warns, and uses `OLD` behavior.

Note

The `OLD` behavior of a policy is `deprecated by definition` and may be removed in a future version of CMake.