diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index adcca0e0b49..d288ffb5f7a 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -609,8 +609,10 @@ if("$ENV{RAPIDJSON_HOME}" STREQUAL "") ExternalProject_Get_Property(rapidjson_ep SOURCE_DIR) set(RAPIDJSON_INCLUDE_DIR "${SOURCE_DIR}/include") + set(RAPIDJSON_VENDORED 1) else() set(RAPIDJSON_INCLUDE_DIR "$ENV{RAPIDJSON_HOME}/include") + set(RAPIDJSON_VENDORED 0) endif() message(STATUS "RapidJSON include dir: ${RAPIDJSON_INCLUDE_DIR}") include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR}) diff --git a/cpp/src/arrow/ipc/CMakeLists.txt b/cpp/src/arrow/ipc/CMakeLists.txt index 6f401dba249..b1669c5f7c2 100644 --- a/cpp/src/arrow/ipc/CMakeLists.txt +++ b/cpp/src/arrow/ipc/CMakeLists.txt @@ -44,6 +44,9 @@ set(ARROW_IPC_SRCS add_library(arrow_ipc SHARED ${ARROW_IPC_SRCS} ) +if(RAPIDJSON_VERDORED) + add_dependencies(arrow_ipc rapidjson_ep) +endif() if(FLATBUFFERS_VENDORED) add_dependencies(arrow_ipc flatbuffers_ep) endif()