Skip to content

Commit 1ef5e4a

Browse files
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 <kyedwards@nvidia.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent cca41a3 commit 1ef5e4a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cpp/cmake_modules/FindRapidJSONAlt.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ endif()
2626
if(RapidJSONAlt_FIND_QUIETLY)
2727
list(APPEND find_package_args QUIET)
2828
endif()
29+
set(_CMAKE_POLICY_VERSION_MINIMUM_OLD ${CMAKE_POLICY_VERSION_MINIMUM})
30+
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
2931
find_package(RapidJSON ${find_package_args})
32+
set(CMAKE_POLICY_VERSION_MINIMUM ${_CMAKE_POLICY_VERSION_MINIMUM_OLD})
3033
if(RapidJSON_FOUND)
3134
set(RapidJSONAlt_FOUND TRUE)
3235
if(NOT TARGET RapidJSON)

0 commit comments

Comments
 (0)