ClickHouse/cmake/find/thrift.cmake

35 lines
1.1 KiB
CMake
Raw Normal View History

2021-11-22 04:29:40 +00:00
option(ENABLE_THRIFT "Enable Thrift" ${ENABLE_LIBRARIES})
2021-11-08 10:41:30 +00:00
2021-11-22 04:29:40 +00:00
if (NOT ENABLE_THRIFT)
message (STATUS "thrift disabled")
set(USE_INTERNAL_THRIFT_LIBRARY 0)
return()
endif()
2021-11-08 10:41:30 +00:00
2021-11-24 10:05:35 +00:00
option(USE_INTERNAL_THRIFT_LIBRARY "Set to FALSE to use system thrift library instead of bundled" ON)
2021-11-22 04:29:40 +00:00
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/thrift")
if (USE_INTERNAL_THRIFT_LIBRARY)
2021-11-24 10:05:35 +00:00
message (WARNING "submodule contrib/thrift is missing. to fix try run: \n git submodule update --init --recursive")
2021-11-22 04:29:40 +00:00
set(USE_INTERNAL_THRIFT_LIBRARY 0)
2021-11-08 10:41:30 +00:00
endif ()
endif()
2021-11-22 04:29:40 +00:00
if (USE_INTERNAL_THRIFT_LIBRARY)
if (MAKE_STATIC_LIBRARIES)
set(THRIFT_LIBRARY thrift_static)
else()
set(THRIFT_LIBRARY thrift)
endif()
set (THRIFT_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/thrift/lib/cpp/src")
set(USE_THRIFT 1)
else()
find_library(THRIFT_LIBRARY thrift)
if (NOT THRIFT_LIBRARY)
set(USE_THRIFT 0)
else()
set(USE_THRIFT 1)
endif()
endif ()
2021-11-22 06:37:12 +00:00
message (STATUS "Using thrift=${USE_THRIFT}: ${THRIFT_INCLUDE_DIR} : ${THRIFT_LIBRARY}")