2020-07-10 19:08:18 +00:00
|
|
|
option (ENABLE_MSGPACK "Enable msgpack library" ${ENABLE_LIBRARIES})
|
|
|
|
|
2020-08-14 15:44:04 +00:00
|
|
|
if(NOT ENABLE_MSGPACK)
|
|
|
|
if(USE_INTERNAL_MSGPACK_LIBRARY)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal msgpack with ENABLE_MSGPACK=OFF")
|
|
|
|
endif()
|
|
|
|
return()
|
|
|
|
endif()
|
2020-07-10 19:08:18 +00:00
|
|
|
|
2020-04-10 07:46:23 +00:00
|
|
|
option (USE_INTERNAL_MSGPACK_LIBRARY "Set to FALSE to use system msgpack library instead of bundled" ${NOT_UNBUNDLED})
|
|
|
|
|
2020-08-14 15:44:04 +00:00
|
|
|
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/msgpack-c/include/msgpack.hpp")
|
|
|
|
if(USE_INTERNAL_MSGPACK_LIBRARY)
|
2020-04-11 20:07:11 +00:00
|
|
|
message(WARNING "Submodule contrib/msgpack-c is missing. To fix try run: \n git submodule update --init --recursive")
|
2020-08-14 15:44:04 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal msgpack")
|
|
|
|
set(USE_INTERNAL_MSGPACK_LIBRARY 0)
|
2020-04-10 07:46:23 +00:00
|
|
|
endif()
|
2020-08-14 15:44:04 +00:00
|
|
|
set(MISSING_INTERNAL_MSGPACK_LIBRARY 1)
|
2020-04-10 07:46:23 +00:00
|
|
|
endif()
|
|
|
|
|
2020-08-14 15:44:04 +00:00
|
|
|
if(NOT USE_INTERNAL_MSGPACK_LIBRARY)
|
2020-04-10 07:46:23 +00:00
|
|
|
find_path(MSGPACK_INCLUDE_DIR NAMES msgpack.hpp PATHS ${MSGPACK_INCLUDE_PATHS})
|
2020-08-14 15:44:04 +00:00
|
|
|
if(NOT MSGPACK_INCLUDE_DIR)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system msgpack")
|
|
|
|
endif()
|
2020-07-10 19:08:18 +00:00
|
|
|
endif()
|
|
|
|
|
2020-08-14 15:44:04 +00:00
|
|
|
if(NOT MSGPACK_INCLUDE_DIR AND NOT MISSING_INTERNAL_MSGPACK_LIBRARY)
|
|
|
|
set(MSGPACK_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/msgpack-c/include")
|
|
|
|
set(USE_INTERNAL_MSGPACK_LIBRARY 1)
|
2020-07-10 19:08:18 +00:00
|
|
|
endif()
|
|
|
|
|
2020-08-14 15:44:04 +00:00
|
|
|
if (MSGPACK_INCLUDE_DIR)
|
|
|
|
set(USE_MSGPACK 1)
|
2020-08-13 20:10:06 +00:00
|
|
|
endif()
|
|
|
|
|
2020-07-10 19:08:18 +00:00
|
|
|
message(STATUS "Using msgpack=${USE_MSGPACK}: ${MSGPACK_INCLUDE_DIR}")
|