@@ -80,19 +80,16 @@ else()
8080 # RapidJSON 1.1.0 (released in 2016) has C++ compatibility issues with GCC 14 (deprecated std::iterator,
8181 # const member assignment). Use master branch which includes these fixes and already has cmake_minimum_required 3.5.
8282 #
83- # Note: Newer RapidJSON changed the CMake variable name from RAPIDJSON_INCLUDE_DIRS to RapidJSON_INCLUDE_DIRS
84- # in RapidJSONConfig.cmake.in (see https://github.com/Tencent/rapidjson/commit/b91c515afea9f0ba6a81fc670889549d77c83db3).
85- # The triton code expects RAPIDJSON_INCLUDE_DIRS: https://github.com/triton-inference-server/common/blob/main/CMakeLists.txt
86- # Our patch adds backward compatibility by also setting RAPIDJSON_INCLUDE_DIRS.
83+ # Note: Newer RapidJSON uses modern CMake with exported targets and changed the variable name from
84+ # RAPIDJSON_INCLUDE_DIRS to RapidJSON_INCLUDE_DIRS. Triton expects the uppercase version, so we pass
85+ # RAPIDJSON_INCLUDE_DIRS directly as a cmake argument to the triton build.
8786 set (RapidJSON_PREFIX ${CMAKE_CURRENT_BINARY_DIR} /_deps/rapidjson)
8887 set (RapidJSON_INSTALL_DIR ${RapidJSON_PREFIX} /install )
89- set (rapidjson_patch_command patch --verbose -p1 -i ${PROJECT_SOURCE_DIR} /cmake/externals/rapidjson_cmake.patch)
9088 ExternalProject_Add(RapidJSON
9189 PREFIX ${RapidJSON_PREFIX}
9290 GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
9391 GIT_TAG master
9492 GIT_SHALLOW TRUE
95- PATCH_COMMAND ${rapidjson_patch_command}
9693 CMAKE_ARGS -DRAPIDJSON_BUILD_DOC=OFF
9794 -DRAPIDJSON_BUILD_EXAMPLES=OFF
9895 -DRAPIDJSON_BUILD_TESTS=OFF
@@ -103,10 +100,10 @@ else()
103100
104101 ExternalProject_Get_Property(RapidJSON SOURCE_DIR BINARY_DIR)
105102 # message(STATUS "RapidJSON src=${SOURCE_DIR} binary=${BINARY_DIR}")
106- # Set RapidJSON_ROOT_DIR for find_package. The required RapidJSONConfig. cmake file is generated in the binary dir
107- set (RapidJSON_ROOT_DIR ${BINARY_DIR} )
108-
109- set (triton_extra_cmake_args "" )
103+ # Set RapidJSON_ROOT_DIR for find_package. The cmake config files are installed to lib/cmake/RapidJSON
104+ set (RapidJSON_ROOT_DIR ${RapidJSON_INSTALL_DIR} /lib/cmake/RapidJSON )
105+ # Triton expects RAPIDJSON_INCLUDE_DIRS (uppercase). Pass it directly as a cmake arg.
106+ set (triton_extra_cmake_args -DRAPIDJSON_INCLUDE_DIRS= ${RapidJSON_INSTALL_DIR} / include )
110107 set (triton_patch_exe patch)
111108 set (triton_dependencies RapidJSON)
112109
0 commit comments