Skip to content

Fix cmake deprecation#314

Merged
ingydotnet merged 1 commit into
yaml:masterfrom
mosfet80:patch-2
May 13, 2026
Merged

Fix cmake deprecation#314
ingydotnet merged 1 commit into
yaml:masterfrom
mosfet80:patch-2

Conversation

@mosfet80
Copy link
Copy Markdown
Contributor

fix cmake deprecation version <3.10

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
Copy Markdown

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
Copy Markdown

Wiil it be merged soon ?

@mosfet80
Copy link
Copy Markdown
Contributor Author

mosfet80 commented Sep 5, 2025

@perlpunk ping.

@alberto-scolari
Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
Contributor Author

mosfet80 commented Oct 8, 2025

Close #317

@mosfet80
Copy link
Copy Markdown
Contributor Author

@ingydotnet Sorry to bother you. You have permission to maintain the repository?

@ingydotnet
Copy link
Copy Markdown
Member

Fixes #317

Sorry this took so long.
libyaml is back in business...

@ingydotnet ingydotnet requested review from nitzmahone and perlpunk May 13, 2026 17:32
@ingydotnet ingydotnet merged commit 893682b into yaml:master May 13, 2026
4 checks passed
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.

6 participants