2017-02-28 23:49:04 +00:00
|
|
|
option (USE_INTERNAL_LZ4_LIBRARY "Set to FALSE to use system lz4 library instead of bundled" ${NOT_UNBUNDLED})
|
|
|
|
|
2019-02-19 20:51:44 +00:00
|
|
|
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/lz4/lib/lz4.h")
|
|
|
|
if (USE_INTERNAL_LZ4_LIBRARY)
|
|
|
|
message (WARNING "submodule contrib/lz4 is missing. to fix try run: \n git submodule update --init --recursive")
|
|
|
|
set (USE_INTERNAL_LZ4_LIBRARY 0)
|
|
|
|
endif ()
|
|
|
|
set (MISSING_INTERNAL_LZ4_LIBRARY 1)
|
2017-10-13 18:52:23 +00:00
|
|
|
endif ()
|
|
|
|
|
2017-02-28 23:49:04 +00:00
|
|
|
if (NOT USE_INTERNAL_LZ4_LIBRARY)
|
2017-04-01 07:20:54 +00:00
|
|
|
find_library (LZ4_LIBRARY lz4)
|
|
|
|
find_path (LZ4_INCLUDE_DIR NAMES lz4.h PATHS ${LZ4_INCLUDE_PATHS})
|
2017-02-28 23:49:04 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (LZ4_LIBRARY AND LZ4_INCLUDE_DIR)
|
2019-02-19 20:51:44 +00:00
|
|
|
elseif (NOT MISSING_INTERNAL_LZ4_LIBRARY)
|
2017-10-13 19:26:06 +00:00
|
|
|
set (LZ4_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/lz4/lib)
|
2017-04-01 07:20:54 +00:00
|
|
|
set (USE_INTERNAL_LZ4_LIBRARY 1)
|
|
|
|
set (LZ4_LIBRARY lz4)
|
2017-02-28 23:49:04 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
message (STATUS "Using lz4: ${LZ4_INCLUDE_DIR} : ${LZ4_LIBRARY}")
|