2018-12-05 13:24:45 +00:00
|
|
|
option (USE_INTERNAL_LIBXML2_LIBRARY "Set to FALSE to use system libxml2 library instead of bundled" ${NOT_UNBUNDLED})
|
|
|
|
|
2018-12-19 16:15:29 +00:00
|
|
|
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/libxml2/libxml.h")
|
|
|
|
if (USE_INTERNAL_LIBXML2_LIBRARY)
|
2021-10-17 23:29:04 +00:00
|
|
|
message (WARNING "submodule contrib/libxml2 is missing. to fix try run: \n git submodule update --init")
|
2020-08-14 15:44:04 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal libxml")
|
2018-12-19 16:15:29 +00:00
|
|
|
set (USE_INTERNAL_LIBXML2_LIBRARY 0)
|
|
|
|
endif ()
|
|
|
|
set (MISSING_INTERNAL_LIBXML2_LIBRARY 1)
|
2018-12-05 13:24:45 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (NOT USE_INTERNAL_LIBXML2_LIBRARY)
|
2019-02-19 20:51:44 +00:00
|
|
|
find_package (LibXml2)
|
|
|
|
#find_library (LIBXML2_LIBRARY libxml2)
|
|
|
|
#find_path (LIBXML2_INCLUDE_DIR NAMES libxml.h PATHS ${LIBXML2_INCLUDE_PATHS})
|
2020-08-14 15:44:04 +00:00
|
|
|
|
|
|
|
if (NOT LIBXML2_LIBRARY OR NOT LIBXML2_INCLUDE_DIR)
|
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system libxml2")
|
|
|
|
endif ()
|
2020-08-21 11:36:50 +00:00
|
|
|
|
|
|
|
if (USE_STATIC_LIBRARIES)
|
|
|
|
find_package(LibLZMA)
|
|
|
|
set (LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES})
|
|
|
|
endif ()
|
2018-12-05 13:24:45 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (LIBXML2_LIBRARY AND LIBXML2_INCLUDE_DIR)
|
2018-12-19 15:37:55 +00:00
|
|
|
elseif (NOT MISSING_INTERNAL_LIBXML2_LIBRARY)
|
2018-12-05 13:24:45 +00:00
|
|
|
set (LIBXML2_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libxml2/include ${ClickHouse_SOURCE_DIR}/contrib/libxml2-cmake/linux_x86_64/include)
|
|
|
|
set (USE_INTERNAL_LIBXML2_LIBRARY 1)
|
2020-08-21 11:36:50 +00:00
|
|
|
set (LIBXML2_LIBRARIES libxml2)
|
2018-12-05 13:24:45 +00:00
|
|
|
endif ()
|
|
|
|
|
2020-08-21 11:36:50 +00:00
|
|
|
message (STATUS "Using libxml2: ${LIBXML2_INCLUDE_DIR} : ${LIBXML2_LIBRARIES}")
|