cpm-cmake / CPM.cmake

📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMake 3.30: Calling FetchContent_Populate() is deprecated

gerhardol opened this issue · comments

New warning with updated CMake 3.30-rc3:

CMake Warning (dev) at /usr/local/src/cmake-3.30.0/share/cmake-3.30/Modules/FetchContent.cmake:1942 (message):
  Calling FetchContent_Populate(MyTools) is deprecated, call
  FetchContent_MakeAvailable(MyTools) instead.  Policy CMP0169 can be set
  to OLD to allow FetchContent_Populate(MyTools) to be called directly for
  now, but the ability to call it with declared details will be removed
  completely in a future version.
Call Stack (most recent call first):
  /home/t052809/gu/git_sync/gev/avap_applicationupdater/avap-util/CMakeConfig/cpm/CPM.cmake:1077 (FetchContent_Populate)
  /home/t052809/gu/git_sync/gev/avap_applicationupdater/avap-util/CMakeConfig/cpm/CPM.cmake:849 (cpm_fetch_package)
  CMakeLists.txt:7 (cpmaddpackage)
This warning is for project developers.  Use -Wno-dev to suppress it.

Hi! I'm experiencing this warning when using CPM 0.40.0. From the discussion I see that the single argument of FetchContent_Populate is being deprecated which is what we use:

CPM.cmake/cmake/CPM.cmake

Lines 1073 to 1079 in d416d9b

if(NOT ${lower_case_name}_POPULATED)
FetchContent_Populate(${PACKAGE})
set(${populated}
TRUE
PARENT_SCOPE
)
endif()

We should either use the full set of parameters or just move to the _MakeAvailable alternative.