ClickHouse/cmake/find_zlib.cmake
proller 0e91c47066 Allow build with external double-conversion lz4 zstd re2 zookeeper (#531)
* Allow build with external double-conversion lz4 zstd re2 zookeeper

* fix

* fix

* freebsd fixes

* spaces

* fix

* fix

* fix

* wip

* move

* fix
2017-03-01 03:49:04 +04:00

22 lines
616 B
CMake

option (USE_INTERNAL_ZLIB_LIBRARY "Set to FALSE to use system zlib library instead of bundled" ${NOT_UNBUNDLED})
if (NOT USE_INTERNAL_ZLIB_LIBRARY)
find_package (ZLIB)
if (ZLIB_FOUND)
include_directories (${ZLIB_INCLUDE_DIRS})
endif ()
endif ()
if (NOT ZLIB_FOUND)
set (USE_INTERNAL_ZLIB_LIBRARY 1)
set (ZLIB_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libzlib-ng")
include_directories (BEFORE ${ZLIB_INCLUDE_DIR})
if (USE_STATIC_LIBRARIES)
set (ZLIB_LIBRARIES zlibstatic)
else ()
set (ZLIB_LIBRARIES zlib)
endif ()
endif ()
message (STATUS "Using zlib: ${ZLIB_INCLUDE_DIR} : ${ZLIB_LIBRARIES}")