CMP0169 — CMake 3.30.4 Documentation

# CMP0169

Added in version 3.30.

Calling `FetchContent_Populate()` with a single argument (the name of a declared dependency) is deprecated.

Prior to the introduction of `FetchContent_MakeAvailable()`, projects populated previously declared content (with `FetchContent_Declare()`) using the following pattern:

    FetchContent_GetProperties(depname)
    if(NOT depname_POPULATED)
      FetchContent_Populate(depname)
      add_subdirectory(${depname_SOURCE_DIR} ${depname_BINARY_DIR})
    endif()

The above pattern does not support a number of features that have been added to `FetchContent` over time. It ignores options like `SYSTEM` and `EXCLUDE_FROM_ALL` which may be given to `FetchContent_Declare()`, but can't be made known to the above project code. It also does not support dependency providers. Projects should call `FetchContent_MakeAvailable()` instead of using the above pattern.

CMake 3.30 and above prefers to reject calls to `FetchContent_Populate()` with the name of a declared dependency. This policy provides compatibility for projects that have not been updated to call `FetchContent_MakeAvailable()` instead.

The `OLD` behavior of this policy allows `FetchContent_Populate()` to be called with the name of a declared dependency. The `NEW` behavior halts with a fatal error in such cases.

Note

Calling `FetchContent_Populate()` with the full population details as command arguments rather than just a dependency name remains fully supported. Only the form calling `FetchContent_Populate()` with a single argument (the name of a previously declared dependency) is deprecated with this policy.

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.