Files
impala/cmake_modules/FindBzip2.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

44 lines
1.1 KiB
CMake

# BZIP2_ROOT hints the location
# Provides
# - BZIP2_LIBRARIES,
# - BZIP2_STATIC,
# - BZIP2_INCLUDE_DIR,
# - BZIP2_FOUND
set(_BZIP2_SEARCH_DIR)
if (BZIP2_ROOT)
set(_BZIP2_SEARCH_DIR PATHS ${BZIP2_ROOT} NO_DEFAULT_PATH)
endif()
find_path(BZIP2_INCLUDE_DIR bzlib.h
${_BZIP2_SEARCH_DIR} PATH_SUFFIXES include)
# Add dynamic and static libraries
find_library(BZIP2_LIBRARIES bz2 ${_BZIP2_SEARCH_DIR} PATH_SUFFIXES lib lib64)
find_library(BZIP2_STATIC_LIBRARIES libbz2.a ${_BZIP2_SEARCH_DIR} PATH_SUFFIXES lib lib64)
if (BZIP2_STATIC_LIBRARIES)
add_library(BZIP2_STATIC STATIC IMPORTED)
set_target_properties(BZIP2_STATIC PROPERTIES
IMPORTED_LOCATION ${BZIP2_STATIC_LIBRARIES})
set(BZIP2_STATIC_FOUND ON)
else()
set(BZIP2_STATIC_FOUND OFF)
set(BZIP2_STATIC ${BZIP2_STATIC_LIBRARIES})
endif()
if (NOT BZIP2_STATIC_LIBRARIES AND
NOT BZIP2_LIBRARIES)
message(FATAL_ERROR "bzip2 not found in ${BZIP2_ROOT}")
set(BZIP2_FOUND FALSE)
else()
set(BZIP2_FOUND TRUE)
message(STATUS "Bzip2: ${BZIP2_INCLUDE_DIR}")
endif()
mark_as_advanced(
BZIP2_INCLUDE_DIR
BZIP2_STATIC
BZIP2_LIBRARIES
)