scnlib icon indicating copy to clipboard operation
scnlib copied to clipboard

FetchContent_MakeAvailable Deprecation Warning

Open jade-42 opened this issue 1 year ago • 0 comments

I am receiving a deprecation notice for FetchContent_MakeAvailable when importing scnlib via CMake.

CMake Warning (dev) at /snap/clion/305/bin/cmake/linux/x64/share/cmake-3.30/Modules/FetchContent.cmake:1953 (message):
  Calling FetchContent_Populate(fast_float) is deprecated, call
  FetchContent_MakeAvailable(fast_float) instead.  Policy CMP0169 can be set
  to OLD to allow FetchContent_Populate(fast_float) 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):
  cmake-build-debug/_deps/scnlib-src/cmake/dependencies.cmake:123 (FetchContent_Populate)
  cmake-build-debug/_deps/scnlib-src/CMakeLists.txt:37 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

In my CMakeLists.txt, the scnlib is being importing via

FetchContent_Declare(
        scnlib
        GIT_REPOSITORY https://github.com/eliaskosunen/scnlib
        GIT_TAG        v4.0.1
        GIT_SHALLOW    TRUE
)
FetchContent_MakeAvailable(scnlib)

The problem appears to be caused by this line https://github.com/eliaskosunen/scnlib/blob/master/cmake/dependencies.cmake#L123

This is with CMake 3.30.

jade-42 avatar Dec 03 '24 16:12 jade-42