Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake 3.30: Calling FetchContent_Populate() is deprecated #568

Closed
gerhardol opened this issue Jun 24, 2024 · 3 comments · Fixed by #570
Closed

CMake 3.30: Calling FetchContent_Populate() is deprecated #568

gerhardol opened this issue Jun 24, 2024 · 3 comments · Fixed by #570

Comments

@gerhardol
Copy link
Contributor

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.
@Curve
Copy link

Curve commented Jul 3, 2024

This discussion: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9552#note_1526701 might be useful

@jmigual
Copy link

jmigual commented Jul 8, 2024

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.

@robertmaynard
Copy link
Contributor

The conversion of CPM over to FetchContent_MakeAvailable is great but did bring to the surface some underlying issues with lowercase project names when used with SOURCE_SUBDIR.

The fix has been merged and will be part of 3.30.3 ( background https://gitlab.kitware.com/cmake/cmake/-/issues/26243 ). But I wanted the CPM team to be aware in case you see issues filed about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants