Improve CMake

This commit is contained in:
Nikolay Degterinsky 2021-08-19 13:48:46 +03:00
parent ecb985c4b5
commit 7825f792ef
3 changed files with 2 additions and 32 deletions

View File

@ -536,7 +536,6 @@ include (cmake/find/rocksdb.cmake)
include (cmake/find/libpqxx.cmake) include (cmake/find/libpqxx.cmake)
include (cmake/find/nuraft.cmake) include (cmake/find/nuraft.cmake)
include (cmake/find/yaml-cpp.cmake) include (cmake/find/yaml-cpp.cmake)
include (cmake/find/lz4.cmake)
include (cmake/find/s2geometry.cmake) include (cmake/find/s2geometry.cmake)
include (cmake/find/nlp.cmake) include (cmake/find/nlp.cmake)
include (cmake/find/bzip2.cmake) include (cmake/find/bzip2.cmake)

View File

@ -1,27 +0,0 @@
option (USE_LZ4 "Set to FALSE to use system lz4 library instead of bundled" ${NOT_UNBUNDLED})
if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/lz4/lib/lz4.h")
if(USE_LZ4)
message(WARNING "submodule contrib/lz4 is missing. to fix try run: \n git submodule update --init --recursive")
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find internal lz4 library")
set(USE_LZ4 0)
endif()
set(MISSING_INTERNAL_LZ4_LIBRARY 1)
endif()
if (NOT USE_LZ4)
find_library (LZ4_LIBRARY lz4)
find_path (LZ4_INCLUDE_DIR NAMES lz4.h PATHS ${LZ4_INCLUDE_PATHS})
if (NOT LZ4_LIBRARY OR NOT LZ4_INCLUDE_DIR)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system lz4 library")
endif ()
endif ()
if (LZ4_LIBRARY AND LZ4_INCLUDE_DIR)
elseif (NOT MISSING_INTERNAL_LZ4_LIBRARY)
set (USE_LZ4 1)
set (LZ4_LIBRARY lz4)
set (LZ4_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/lz4/lib)
endif ()
message (STATUS "Using lz4: ${LZ4_INCLUDE_DIR} : ${LZ4_LIBRARY}")

View File

@ -474,10 +474,8 @@ if (USE_DATASKETCHES)
target_include_directories (clickhouse_aggregate_functions SYSTEM BEFORE PRIVATE ${DATASKETCHES_INCLUDE_DIR}) target_include_directories (clickhouse_aggregate_functions SYSTEM BEFORE PRIVATE ${DATASKETCHES_INCLUDE_DIR})
endif () endif ()
if (USE_LZ4) target_link_libraries (clickhouse_common_io PRIVATE lz4)
target_link_libraries (clickhouse_common_io PRIVATE ${LZ4_LIBRARY}) target_include_directories (clickhouse_common_io SYSTEM BEFORE PRIVATE lz4)
target_include_directories (clickhouse_common_io SYSTEM BEFORE PRIVATE ${LZ4_INCLUDE_DIR})
endif()
dbms_target_link_libraries(PRIVATE _boost_context) dbms_target_link_libraries(PRIVATE _boost_context)