Skip to content

mongo-c-driver: declare valid CMake range - #30788

Open
Dahlgren wants to merge 1 commit into
conan-io:masterfrom
Dahlgren:package/mongo-c-driver-cmake
Open

mongo-c-driver: declare valid CMake range#30788
Dahlgren wants to merge 1 commit into
conan-io:masterfrom
Dahlgren:package/mongo-c-driver-cmake

Conversation

@Dahlgren

@Dahlgren Dahlgren commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes to recipe: mongo-c-driver

Motivation

It's not possible to compile mongo-c-driver recipe when newer versions of CMake are on system path, the recipe doesn't declare any CMake range

Details


  • Read the contributing guidelines
  • Checked that this PR is not a duplicate: list of PRs by recipe
  • If this is a bug fix, please link related issue or provide bug details
  • Tested locally with at least one configuration using a recent version of Conan

Add a 👍 reaction to pull requests you find important to help the team prioritize, thanks!

- <2.4.0 has broken TRY_COMPILE in src/libmongoc/CMakeLists.txt, failing in CMake 4.4+
  - mongodb/mongo-c-driver@ea1b547
- <1.30.3/<2.1.0 has CMP0042 OLD in src/libbson/CMakeLists.txt, removed in CMake 4+
  - mongodb/mongo-c-driver@2344038
  - mongodb/mongo-c-driver@c60f45f
- <1.25 has cmake_minimum_required (VERSION 3.1) in src/libbson/CMakeLists.txt, rejected in CMake 4+
  - mongodb/mongo-c-driver@3c7951b#diff-71a4c7cf57df62b3b3d8bb547bcf79c5fafb5accb4a6608d696ccdf43e17ad6a
@jcar87

jcar87 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Does defining CMAKE_POLICY_VERSION_MINIMUM (to 3.5 as minimum) as suggested in #26878 not work?

Clipping the version range of CMake to <4 would prevent usage with Visual Studio 2026. I'd say we would only do this if the build script truly does not work with CMake <4 even with the policy workaround.

@Dahlgren

Dahlgren commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Does defining CMAKE_POLICY_VERSION_MINIMUM (to 3.5 as minimum) as suggested in #26878 not work?

It only fixes the last issue with cmake_minimum_required (VERSION 3.1), if we drop older versions we can go up to <4.4

@jcar87

jcar87 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

I'm a bit confused. What version of mongo-c-driver are you attempting to build from source, and what error are you getting if you attempt to build that with CMake 4.0? thanks!

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.

2 participants