This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 1ef5e4a81a GH-48801: [C++] Set CMAKE_POLICY_VERSION_MINIMUM for 
RapidJSON (#49993)
1ef5e4a81a is described below

commit 1ef5e4a81aec397e933a4742e51499550aa16f92
Author: Kyle Edwards <[email protected]>
AuthorDate: Wed May 20 20:37:18 2026 -0400

    GH-48801: [C++] Set CMAKE_POLICY_VERSION_MINIMUM for RapidJSON (#49993)
    
    ### 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?
    
    * GitHub Issue: #48801
    
    Authored-by: Kyle Edwards <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/cmake_modules/FindRapidJSONAlt.cmake | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cpp/cmake_modules/FindRapidJSONAlt.cmake 
b/cpp/cmake_modules/FindRapidJSONAlt.cmake
index babb450e20..148dd93a78 100644
--- a/cpp/cmake_modules/FindRapidJSONAlt.cmake
+++ b/cpp/cmake_modules/FindRapidJSONAlt.cmake
@@ -26,7 +26,10 @@ endif()
 if(RapidJSONAlt_FIND_QUIETLY)
   list(APPEND find_package_args QUIET)
 endif()
+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})
 if(RapidJSON_FOUND)
   set(RapidJSONAlt_FOUND TRUE)
   if(NOT TARGET RapidJSON)

Reply via email to