Permalink
Switch branches/tags
v1.2.2 v0.7.1refresh v0.7refresh v0.6refresh v0.5refresh v0.4refresh v0.3refresh v0.1refresh impala-v1.2.1 impala-v1.1.1 impala-v1.1 impala-v1.0 cdh5.15.1-release cdh5.15.0-release cdh5.14.4-release cdh5.14.2-release cdh5.14.0-release cdh5.13.3-release cdh5.13.2-release cdh5.13.1-release cdh5.13.0-release cdh5.12.2-release cdh5.12.1-release cdh5.12.0-release cdh5.11.2-release cdh5.11.1-release cdh5.11.0-release cdh5.10.2-release cdh5.10.1-release cdh5.10.0-release cdh5.9.3-release cdh5.9.2-release cdh5.9.1-release cdh5.9.0-release cdh5.8.5-release cdh5.8.4-release cdh5.8.3-release cdh5.8.2-release cdh5.8.0-release cdh5.7.6-release cdh5.7.5-release cdh5.7.4-release cdh5.7.3-release cdh5.7.2-release cdh5.7.1-release cdh5.7.0-release cdh5.6.1-release cdh5.6.0-release cdh5.5.6-release cdh5.5.5-release cdh5.5.4-release cdh5.5.2-release cdh5.5.1-release cdh5.5.0-release cdh5.4.11-release cdh5.4.10-release cdh5.4.9-release cdh5.4.8-release cdh5.4.7-release cdh5.4.5-release cdh5.4.4-release cdh5.4.3-release cdh5.4.2-release cdh5.4.1-release cdh5.4.0-release cdh5.3.10-release cdh5.3.9-release cdh5.3.8-release cdh5.3.6-release cdh5.3.5-release cdh5.3.4-release cdh5.3.3-release cdh5.3.2-release cdh5.3.1-release cdh5.3.0-release cdh5.2.6-release cdh5.2.5-release cdh5.2.4-release cdh5.2.3-release cdh5.2.2-release cdh5.2.1-release cdh5.2.0-release cdh5.1.5-release cdh5.1.4-release cdh5.1.3-release cdh5.1.2-release cdh5.1.0_v1.4 cdh5.1.0-release cdh5.0.6-release cdh5.0.5-release cdh5.0.3-release cdh5.0.2_v1.3.1 cdh5.0.2-release cdh5.0.1-release cdh4_v2.0 cdh4_v1.4 cdh4_v1.3.1
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (54 sloc) 1.61 KB
# - Find HDFS (hdfs.h and libhdfs.so)
# This module defines
# Hadoop_VERSION, version string of ant if found
# HDFS_INCLUDE_DIR, directory containing hdfs.h
# HDFS_LIBS, location of libhdfs.so
# HDFS_FOUND, If false, do not try to use ant
exec_program(hadoop ARGS version OUTPUT_VARIABLE Hadoop_VERSION
RETURN_VALUE Hadoop_RETURN)
# currently only looking in HADOOP_HOME
find_path(HDFS_INCLUDE_DIR hdfs.h PATHS
$ENV{HADOOP_HOME}/include/
# make sure we don't accidentally pick up a different version
NO_DEFAULT_PATH
)
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(arch_hint "x64")
elseif ("$ENV{LIB}" MATCHES "(amd64|ia64)")
set(arch_hint "x64")
else ()
set(arch_hint "x86")
endif()
message(STATUS "Architecture: ${arch_hint}")
if ("${arch_hint}" STREQUAL "x64")
set(HDFS_LIB_PATHS $ENV{HADOOP_HOME}/lib/native)
else ()
set(HDFS_LIB_PATHS $ENV{HADOOP_HOME}/lib/native)
endif ()
message(STATUS "HDFS_LIB_PATHS: ${HDFS_LIB_PATHS}")
find_library(HDFS_LIB NAMES hdfs PATHS
${HDFS_LIB_PATHS}
# make sure we don't accidentally pick up a different version
NO_DEFAULT_PATH
)
if (HDFS_LIB)
set(HDFS_FOUND TRUE)
set(HDFS_LIBS ${HDFS_LIB})
else ()
set(HDFS_FOUND FALSE)
endif ()
if (HDFS_FOUND)
if (NOT HDFS_FIND_QUIETLY)
message(STATUS "${Hadoop_VERSION}")
message(STATUS "HDFS_INCLUDE_DIR: ${HDFS_INCLUDE_DIR}")
message(STATUS "HDFS_LIBS: ${HDFS_LIBS}")
endif ()
else ()
message(STATUS "HDFS includes and libraries NOT found."
"Thrift support will be disabled (${Thrift_RETURN}, "
"${HDFS_INCLUDE_DIR}, ${HDFS_LIB})")
endif ()
mark_as_advanced(
HDFS_LIBS
HDFS_INCLUDE_DIR
)