Skip to content

GH-48801: [C++] Set CMAKE_POLICY_VERSION_MINIMUM for RapidJSON#49993

Open
KyleFromNVIDIA wants to merge 1 commit into
apache:mainfrom
KyleFromNVIDIA:rapidjson-cmake-policy-version-minimum
Open

GH-48801: [C++] Set CMAKE_POLICY_VERSION_MINIMUM for RapidJSON#49993
KyleFromNVIDIA wants to merge 1 commit into
apache:mainfrom
KyleFromNVIDIA:rapidjson-cmake-policy-version-minimum

Conversation

@KyleFromNVIDIA
Copy link
Copy Markdown

@KyleFromNVIDIA KyleFromNVIDIA commented May 19, 2026

Rationale for this change

We already set this variable when adding projects through ExternalProject_Add(), but the config file that RapidJSON exports sets cmake_minimum_required() to a version older than 3.5. Set the policy minimum when searching for the just-built RapidJSON.

What changes are included in this PR?

Set CMAKE_POLICY_VERSION_MINIMUM in FindRapidJSONAlt.cmake

Are these changes tested?

Tested locally

Are there any user-facing changes?

We already set this variable when adding projects through
`ExternalProject_Add()`, but the config file that RapidJSON exports
sets `cmake_minimum_required()` to a version older than 3.5. Set
the policy minimum when searching for the just-built RapidJSON.
@github-actions
Copy link
Copy Markdown

⚠️ GitHub issue #48801 has been automatically assigned in GitHub to PR creator.

@github-actions
Copy link
Copy Markdown

⚠️ GitHub issue #48801 has been automatically assigned in GitHub to PR creator.

@KyleFromNVIDIA KyleFromNVIDIA changed the title GH-48801: [cmake] Set CMAKE_POLICY_VERSION_MINIMUM for RapidJSON GH-48801: [C++] Set CMAKE_POLICY_VERSION_MINIMUM for RapidJSON May 19, 2026
@github-actions
Copy link
Copy Markdown

⚠️ GitHub issue #48801 has been automatically assigned in GitHub to PR creator.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses CMake 4.x configuration failures caused by RapidJSON’s exported RapidJSONConfig.cmake using an old cmake_minimum_required() version by temporarily setting CMAKE_POLICY_VERSION_MINIMUM when FindRapidJSONAlt.cmake calls find_package(RapidJSON).

Changes:

  • Temporarily sets CMAKE_POLICY_VERSION_MINIMUM to 3.5 around find_package(RapidJSON ...) in the RapidJSON “Alt” find module.
  • Restores CMAKE_POLICY_VERSION_MINIMUM afterward.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +29 to +32
set(_CMAKE_POLICY_VERSION_MINIMUM_OLD ${CMAKE_POLICY_VERSION_MINIMUM})
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
find_package(RapidJSON ${find_package_args})
set(CMAKE_POLICY_VERSION_MINIMUM ${_CMAKE_POLICY_VERSION_MINIMUM_OLD})
@kou
Copy link
Copy Markdown
Member

kou commented May 20, 2026

Error message: rapidsai/cudf#22540

@kou
Copy link
Copy Markdown
Member

kou commented May 20, 2026

GH-48801 is for bundled RapidJSON but this is for system RapidJSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants