ClickHouse/cmake/find/hdfs3.cmake

46 lines
1.8 KiB
CMake
Raw Normal View History

if(NOT ARCH_ARM AND NOT OS_FREEBSD AND NOT APPLE AND USE_PROTOBUF AND NOT ARCH_PPC64LE)
option(ENABLE_HDFS "Enable HDFS" ${ENABLE_LIBRARIES})
elseif(ENABLE_HDFS OR USE_INTERNAL_HDFS3_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use HDFS3 with current configuration")
endif()
if(NOT ENABLE_HDFS)
if(USE_INTERNAL_HDFS3_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal HDFS3 library with ENABLE_HDFS3=OFF")
endif()
return()
endif()
option(USE_INTERNAL_HDFS3_LIBRARY "Set to FALSE to use system HDFS3 instead of bundled (experimental - set to OFF on your own risk)"
ON) # We don't know any linux distribution with package for it
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libhdfs3/include/hdfs/hdfs.h")
if(USE_INTERNAL_HDFS3_LIBRARY)
2021-10-17 23:29:04 +00:00
message(WARNING "submodule contrib/libhdfs3 is missing. to fix try run: \n git submodule update --init")
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot use internal HDFS3 library")
set(USE_INTERNAL_HDFS3_LIBRARY 0)
endif()
set(MISSING_INTERNAL_HDFS3_LIBRARY 1)
endif()
2018-11-19 08:17:09 +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})
if(NOT HDFS3_LIBRARY OR NOT HDFS3_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot find system HDFS3 library")
endif()
endif()
2018-11-19 08:17:09 +00:00
if(HDFS3_LIBRARY AND HDFS3_INCLUDE_DIR)
2018-12-18 13:37:00 +00:00
set(USE_HDFS 1)
elseif(NOT MISSING_INTERNAL_HDFS3_LIBRARY AND LIBGSASL_LIBRARY AND LIBXML2_LIBRARIES)
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)
set(USE_INTERNAL_HDFS3_LIBRARY 1)
2018-12-18 13:37:00 +00:00
set(USE_HDFS 1)
else()
message (${RECONFIGURE_MESSAGE_LEVEL} "Cannout enable HDFS3")
endif()
2018-11-19 08:17:09 +00:00
message(STATUS "Using hdfs3=${USE_HDFS}: ${HDFS3_INCLUDE_DIR} : ${HDFS3_LIBRARY}")