Skip to content

FetchContent: Make FetchContent_Populate() honor CMP0168

!9513 (merged) added policy CMP0168 which uses direct population without a sub-build. That policy was meant to affect all uses of FetchContent_Populate(), but an oversight meant it was not applied when passing the full details to FetchContent_Populate() rather than just the dependency name. Such a scenario occurs when that command is used in CMake script mode.

There was also a weakness in the RunCMake.FetchContent test's ScriptMode sub-test case which should have caught this, but it wasn't calling cmake_minimum_required() at the start of the test. Subsequently calling include(FetchContent) was resetting policies that were set earlier in the test logic, which meant the test case was always testing with the policy unset.

Merge request reports