From 6c5e1e4559f123cf090643670b660176f3731ca8 Mon Sep 17 00:00:00 2001 From: Hyunsu Cho Date: Fri, 24 May 2024 15:52:00 -0700 Subject: [PATCH 1/2] Compatibility patch for latest RapidJSON --- cmake/ExternalLibs.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmake/ExternalLibs.cmake b/cmake/ExternalLibs.cmake index b0149826..dc695df1 100644 --- a/cmake/ExternalLibs.cmake +++ b/cmake/ExternalLibs.cmake @@ -5,7 +5,15 @@ add_library(rapidjson INTERFACE) target_compile_definitions(rapidjson INTERFACE -DRAPIDJSON_HAS_STDSTRING=1) find_package(RapidJSON) if(RapidJSON_FOUND) - target_include_directories(rapidjson INTERFACE ${RAPIDJSON_INCLUDE_DIRS}) + if(DEFINED RAPIDJSON_INCLUDE_DIRS) + # Compatibility with 1.1.0 stable (circa 2016) + set(RapidJSON_include_dir "${RAPIDJSON_INCLUDE_DIRS}") + else() + # Latest RapidJSON (1.1.0.post*) + set(RapidJSON_include_dir "${RapidJSON_INCLUDE_DIRS}") + endif() + target_include_directories(rapidjson INTERFACE ${RapidJSON_include_dir}) + message(STATUS "Found RapidJSON: ${RapidJSON_include_dir}") else() message(STATUS "Did not find RapidJSON in the system root. Fetching RapidJSON now...") FetchContent_Declare( From f6ac4cd0c17d7f833c3b94b3e76f722fc8fa2f14 Mon Sep 17 00:00:00 2001 From: Hyunsu Cho Date: Fri, 24 May 2024 15:54:38 -0700 Subject: [PATCH 2/2] Use latest RapidJSON --- cmake/ExternalLibs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/ExternalLibs.cmake b/cmake/ExternalLibs.cmake index dc695df1..6556f1ae 100644 --- a/cmake/ExternalLibs.cmake +++ b/cmake/ExternalLibs.cmake @@ -19,7 +19,7 @@ else() FetchContent_Declare( RapidJSON GIT_REPOSITORY https://github.com/Tencent/rapidjson - GIT_TAG v1.1.0 + GIT_TAG ab1842a2dae061284c0a62dca1cc6d5e7e37e346 ) FetchContent_Populate(RapidJSON) message(STATUS "RapidJSON was downloaded at ${rapidjson_SOURCE_DIR}.")