Skip to content

[C++] Address "Compatibility with CMake < 3.5 has been removed" error #48801

@meher745

Description

@meher745

Describe the bug, including details regarding any error messages, version, and platform.

When building the C++ library with CMake 4.0 or newer, the configuration stage fails with a fatal error. This occurs because CMake 4.0 has officially removed support for policies older than 3.5.

Several bundled third-party dependencies (notably RapidJSON) specify a cmake_minimum_required version as low as 2.8 in their internal build files. When CMake 4.x encounters these, it halts the build process.

Image

Currently, the following implementation exists in cpp/cmake_modules/ThirdpartyToolchain.cmake :

Image

However, it appears to be defined too late for certain build configurations. When using CMake 4.0+, the configuration triggers a fatal error the moment a bundled dependency (like RapidJSON) is evaluated.

Proposed Adjustment

Moving set(CMAKE_POLICY_VERSION_MINIMUM 3.5) to cpp/CMakeLists.txt (before any sub-modules or dependencies are included).

Component(s)

C++

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions