2019-06-14 10:28:30 +00:00
|
|
|
option(ENABLE_RAPIDJSON "Use rapidjson" ON)
|
|
|
|
if(NOT ENABLE_RAPIDJSON)
|
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
|
|
|
|
2019-06-14 10:28:30 +00:00
|
|
|
option(USE_INTERNAL_RAPIDJSON_LIBRARY "Set to FALSE to use system rapidjson library instead of bundled" ${NOT_UNBUNDLED})
|
|
|
|
|
|
|
|
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/rapidjson/include/rapidjson/rapidjson.h")
|
|
|
|
if(USE_INTERNAL_RAPIDJSON_LIBRARY)
|
|
|
|
message(WARNING "submodule contrib/rapidjson is missing. to fix try run: \n git submodule update --init --recursive")
|
|
|
|
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})
|
|
|
|
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}")
|