Skip to content

Conversation

@mosfet80
Copy link

fix cmake deprecation version <3.10

fix cmake version <3.10 deprecation
kbingham pushed a commit to kbingham/libcamera that referenced this pull request Jun 30, 2025
Use the libyaml wrap file from the meson wrapdb instead of
creating the wrap file manually and using the cmake module.
This provides better integration with meson, such as the
`force_fallback_for` built-in option.

This is also needed because the upstream CMakeLists.txt is
out of date, failing with a sufficiently new cmake version:

    CMake Error at CMakeLists.txt:2 (cmake_minimum_required):
    Compatibility with CMake < 3.5 has been removed from CMake.

The above is nonetheless addressed by yaml/libyaml#314,
but the project seems a bit inactive at the moment.

The wrap file was added using `meson wrap install libyaml`,
and it can be updated using `meson wrap update libyaml`.

`default_library=static` is used to match the behaviour of the
previously used cmake build. `werror=false` needs to be set
because libyaml does not compile without warnings, and that
would abort the build process otherwise.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
@ImOnALampshade
Copy link

I just filed #317 on this very issue - this is a simple fix, and is important for VCPKG be able to build on newer systems with CMake version 4. Hopefully it makes it in soon!

@mosfet80 mosfet80 changed the title Update CMakeLists.txt Fix cmake deprecation Jul 30, 2025
@guifran001
Copy link

Wiil it be merged soon ?

@mosfet80
Copy link
Author

mosfet80 commented Sep 5, 2025

@perlpunk ping.

@alberto-scolari
Copy link

Would it be possible to prioritise this PR? The related CMake problem is popping up in multiple scenarios: package managers (vcpkg, conan), CIs (which tend to use recent CMake versions), casual users. What further exacerbates the problem is the tendency to adopt recent CMake versions, as CMake evolved rapidly in the latest years and people need those new features. Furthermore, dev tools (conan, Conda, Pixi, ...) make it easy to use recent versions of CMake. Hence, supporting recent versions of it is very important for users.

@lawmurray
Copy link

For others encountering this issue, a workaround is to overrideCMAKE_POLICY_VERSION_MINIMUM when configuring, e.g.:

cmake .. -DCMAKE_POLICY_VERSION_MINIMUM="3.10"

@mosfet80
Copy link
Author

mosfet80 commented Oct 8, 2025

Close #317

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 this pull request may close these issues.

5 participants