Files
impala/cmake_modules/FindZlib.cmake
Martin Grund 81f247b171 Optional Impala Toolchain
This patch allows to optionally enable the new Impala binary
toolchain. For now there are now major version differences in the
toolchain dependencies and what is currently kept in thirdparty.

To enable the toolchain, export the variable IMPALA_TOOLCHAIN to the
folder where the binaries are available.

In addition this patch moves gutil from the thirdparty directory into
the source tree of be/src to allow easy propagation of compiler and
linker flags. Furthermore, the thrift-cpp target was added as a
dependency to all targets that require the generated thrift sources to
be available before the build is started.

What is the new toolchain: The goal of the toolchain is to homogenize
the build environment and to make sure that Impala is build nearly
identical on every platform. To achieve this, we limit the flexibility
of using the systems host libraries and rather rely on a set of custom
produced binaries including the necessary compiler.

Change-Id: If2dac920520e4a18be2a9a75b3184a5bd97a065b
Reviewed-on: http://gerrit.cloudera.org:8080/427
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Internal Jenkins
Reviewed-by: Martin Grund <mgrund@cloudera.com>
2015-06-13 03:11:44 +00:00

47 lines
1.1 KiB
CMake

# ZLIB_ROOT hints the location
# Provides
# - ZLIB,
# - ZLIB_LIBRARIES,
# - ZLIB_STATIC,
# - ZLIB_FOUND
set(_ZLIB_SEARCH_DIR)
if (ZLIB_ROOT)
set(_ZLIB_SEARCH_DIR PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
endif()
find_path(ZLIB_INCLUDE_DIR zlib.h ${_ZLIB_SEARCH_DIR}
PATH_SUFFIXES include)
find_library(ZLIB_STATIC_LIBRARIES libz.a
${_ZLIB_SEARCH_DIR} PATH_SUFFIXES lib lib64)
if (ZLIB_STATIC_LIBRARIES)
add_library(ZLIB_STATIC STATIC IMPORTED)
set_target_properties(ZLIB_STATIC PROPERTIES
IMPORTED_LOCATION ${ZLIB_STATIC_LIBRARIES})
set(ZLIB_STATIC_FOUND ON)
else()
set(ZLIB_STATIC_FOUND OFF)
set(ZLIB_STATIC ${ZLIB_STATIC_LIBRARIES})
endif()
set(ZLIB_NAMES z zlib zdll zlib1 zlibd zlibd1)
find_library(ZLIB_LIBRARIES ${ZLIB_NAMES}
${_ZLIB_SEARCH_DIR} PATH_SUFFIXES lib lib64)
if (NOT ZLIB_LIBRARIES AND NOT ZLIB_STATIC_LIBRARIES)
message(FATAL_ERROR "zlib not found in ${ZLIB_ROOT}")
set(ZLIB_FOUND FALSE)
else()
message(STATUS "Zlib: ${ZLIB_INCLUDE_DIR}")
set(ZLIB_FOUND TRUE)
endif()
mark_as_advanced(
ZLIB_INCLUDE_DIR
ZLIB_LIBRARIES
ZLIB_STATIC
ZLIB_STATIC_FOUND
)