2019-10-05 19:25:31 +00:00
|
|
|
option(ENABLE_RAPIDJSON "Use rapidjson" ${ENABLE_LIBRARIES})
|
2019-06-14 10:28:30 +00:00
|
|
|
if(NOT ENABLE_RAPIDJSON)
|
2020-08-14 15:44:04 +00:00
|
|
|
if(USE_INTERNAL_RAPIDJSON_LIBRARY)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't use internal rapidjson library with ENABLE_RAPIDJSON=OFF")
|
|
|
|
endif()
|
2019-05-16 17:40:24 +00:00
|
|
|
return()
|
2019-06-14 10:28:30 +00:00
|
|
|
endif()
|
2019-05-16 17:40:24 +00:00
|
|
|
|
2021-11-21 10:58:26 +00:00
|
|
|
option(USE_INTERNAL_RAPIDJSON_LIBRARY "Set to FALSE to use system rapidjson library instead of bundled" ON)
|
2019-06-14 10:28:30 +00:00
|
|
|
|
|
|
|
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/rapidjson/include/rapidjson/rapidjson.h")
|
|
|
|
if(USE_INTERNAL_RAPIDJSON_LIBRARY)
|
2021-10-17 23:29:04 +00:00
|
|
|
message(WARNING "submodule contrib/rapidjson is missing. to fix try run: \n git submodule update --init")
|
2020-08-14 15:44:04 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal rapidjson library")
|
2019-06-14 10:28:30 +00:00
|
|
|
set(USE_INTERNAL_RAPIDJSON_LIBRARY 0)
|
|
|
|
endif()
|
|
|
|
set(MISSING_INTERNAL_RAPIDJSON_LIBRARY 1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT USE_INTERNAL_RAPIDJSON_LIBRARY)
|
|
|
|
find_path(RAPIDJSON_INCLUDE_DIR NAMES rapidjson/rapidjson.h PATHS ${RAPIDJSON_INCLUDE_PATHS})
|
2020-08-14 15:44:04 +00:00
|
|
|
if(NOT RAPIDJSON_INCLUDE_DIR)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system rapidjson")
|
|
|
|
endif()
|
2019-06-14 10:28:30 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(RAPIDJSON_INCLUDE_DIR)
|
|
|
|
set(USE_RAPIDJSON 1)
|
|
|
|
elseif(NOT MISSING_INTERNAL_RAPIDJSON_LIBRARY)
|
|
|
|
set(RAPIDJSON_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/rapidjson/include")
|
|
|
|
set(USE_INTERNAL_RAPIDJSON_LIBRARY 1)
|
|
|
|
set(USE_RAPIDJSON 1)
|
|
|
|
endif()
|
2019-05-16 17:40:24 +00:00
|
|
|
|
|
|
|
message(STATUS "Using rapidjson=${USE_RAPIDJSON}: ${RAPIDJSON_INCLUDE_DIR}")
|