2019-09-09 21:40:40 +00:00
|
|
|
if(NOT ARCH_ARM AND NOT OS_FREEBSD AND NOT APPLE AND USE_PROTOBUF)
|
2019-10-05 19:25:31 +00:00
|
|
|
option(ENABLE_HDFS "Enable HDFS" ${ENABLE_LIBRARIES})
|
2019-09-09 21:40:40 +00:00
|
|
|
endif()
|
2018-12-05 13:24:45 +00:00
|
|
|
|
2020-08-13 20:10:06 +00:00
|
|
|
if(ENABLE_HDFS)
|
2019-09-09 21:40:40 +00:00
|
|
|
option(USE_INTERNAL_HDFS3_LIBRARY "Set to FALSE to use system HDFS3 instead of bundled" ${NOT_UNBUNDLED})
|
2018-12-07 15:13:16 +00:00
|
|
|
|
2019-09-09 21:40:40 +00:00
|
|
|
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libhdfs3/include/hdfs/hdfs.h")
|
|
|
|
if(USE_INTERNAL_HDFS3_LIBRARY)
|
2020-08-13 20:10:06 +00:00
|
|
|
message(WARNING "submodule contrib/libhdfs3 is missing. to fix try run: \n git submodule update --init --recursive")
|
2019-09-09 21:40:40 +00:00
|
|
|
endif()
|
|
|
|
set(MISSING_INTERNAL_HDFS3_LIBRARY 1)
|
2020-08-13 20:10:06 +00:00
|
|
|
set(USE_INTERNAL_HDFS3_LIBRARY 0)
|
2019-09-09 21:40:40 +00:00
|
|
|
endif()
|
2018-11-19 08:17:09 +00:00
|
|
|
|
2019-09-09 21:40:40 +00:00
|
|
|
if(NOT USE_INTERNAL_HDFS3_LIBRARY)
|
|
|
|
find_library(HDFS3_LIBRARY hdfs3)
|
|
|
|
find_path(HDFS3_INCLUDE_DIR NAMES hdfs/hdfs.h PATHS ${HDFS3_INCLUDE_PATHS})
|
|
|
|
endif()
|
2018-11-19 08:17:09 +00:00
|
|
|
|
2019-09-09 21:40:40 +00:00
|
|
|
if(HDFS3_LIBRARY AND HDFS3_INCLUDE_DIR)
|
2018-12-18 13:37:00 +00:00
|
|
|
set(USE_HDFS 1)
|
2019-09-09 21:40:40 +00:00
|
|
|
elseif(NOT MISSING_INTERNAL_HDFS3_LIBRARY AND LIBGSASL_LIBRARY AND LIBXML2_LIBRARY)
|
2018-12-04 13:19:00 +00:00
|
|
|
set(HDFS3_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libhdfs3/include")
|
2018-11-19 08:17:09 +00:00
|
|
|
set(HDFS3_LIBRARY hdfs3)
|
2019-09-09 21:40:40 +00:00
|
|
|
set(USE_INTERNAL_HDFS3_LIBRARY 1)
|
2018-12-18 13:37:00 +00:00
|
|
|
set(USE_HDFS 1)
|
|
|
|
else()
|
2020-08-13 20:10:06 +00:00
|
|
|
set(USE_INTERNAL_HDFS3_LIBRARY 0)
|
|
|
|
endif()
|
|
|
|
|
2018-12-05 13:24:45 +00:00
|
|
|
endif()
|
2018-11-19 08:17:09 +00:00
|
|
|
|
2019-09-09 21:40:40 +00:00
|
|
|
message(STATUS "Using hdfs3=${USE_HDFS}: ${HDFS3_INCLUDE_DIR} : ${HDFS3_LIBRARY}")
|