Skip to content
Permalink
Browse files

tools/kafka_repeater: add libsasl2 as dependency

  • Loading branch information...
SwimmingTiger committed Jul 30, 2019
1 parent 4b6e321 commit 90a5d637af4d345bc6f2fd4faddcbd48380c75ba
@@ -0,0 +1,28 @@
# Try and find libsasl2.
# As soon as libsasl2 has been found, the following variables will be defined:
#
# SASL2_FOUND
# SASL2_INCLUDE_DIR
# SASL2_LIBRARIES:FILEPATH
#
# Copyright (c) 2009 Juergen Leising <jleising@users.sourceforge.net>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#

FIND_PATH(SASL2_INCLUDE_DIR NAMES sasl/sasl.h
PATHS /include /usr/include /usr/local/include /usr/share/include /opt/include
DOC "Try and find the header file sasl/sasl.h")

FIND_LIBRARY(SASL2_LIBRARIES NAMES sasl2
PATHS /usr/lib /lib /usr/local/lib /usr/share/lib /opt/lib /opt/share/lib /var/lib
DOC "Try and find libsasl2")

MARK_AS_ADVANCED(SASL2_LIBRARIES SASL2_INCLUDE_DIR)

# handle the QUIETLY and REQUIRED arguments and set SASL2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SASL2 REQUIRED_VARS SASL2_LIBRARIES SASL2_INCLUDE_DIR)
@@ -28,50 +28,26 @@ ENDIF()

###################################### Libs ######################################

find_package(LibConfig)
if(NOT LIBCONFIGPP_FOUND)
message(FATAL_ERROR "LibConfig++ not found!")
endif()

find_package(Glog)
if(NOT GLOG_FOUND)
message(FATAL_ERROR "Glog not found!")
endif()

find_package(KafkaC)
if(NOT KAFKA_FOUND)
message(FATAL_ERROR "librdkafka not found!")
endif()

find_package(LibPthread)
if(NOT PTHREAD_FOUND)
message(FATAL_ERROR "libpthread not found!")
endif()

find_package(Boost 1.36.0 COMPONENTS thread filesystem system regex program_options)
if(NOT Boost_FOUND)
message(FATAL_ERROR "Boost not found!")
endif()

find_package(OpenSSL)
if(NOT OPENSSL_FOUND)
message(FATAL_ERROR "OpenSSL not found!")
endif()

find_package(ZLIB)
if(NOT ZLIB_FOUND)
message(FATAL_ERROR "ZLib not found!")
endif()
find_package(LibConfig REQUIRED)
find_package(Glog REQUIRED)
find_package(KafkaC REQUIRED)
find_package(LibPthread REQUIRED)
find_package(Boost 1.36.0 COMPONENTS thread filesystem system regex program_options REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Sasl2 REQUIRED)


###################################### Targets ######################################

include_directories(${PROJECT_ROOT}/3rdparty ${PROJECT_ROOT}/src ${PROJECT_ROOT}/tools/common
${GLOG_INCLUDE_DIRS} ${KAFKA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}
${LIBCONFIGPP_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
${LIBCONFIGPP_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}
${SASL2_INCLUDE_DIR})

set(THIRD_LIBRARIES ${GLOG_LIBRARIES} ${KAFKA_LIBRARIES} ${LIBCONFIGPP_LIBRARY} ${Boost_LIBRARIES}
${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ${PTHREAD_LIBRARIES} ${ZLIB_LIBRARIES})
${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ${PTHREAD_LIBRARIES} ${ZLIB_LIBRARIES}
${SASL2_LIBRARIES})

file(GLOB SOURCES
${PROJECT_ROOT}/src/Kafka.cc
@@ -27,6 +27,7 @@ RUN apt-get update && apt-get install -y \
libssl-dev \
libtool \
libzookeeper-mt-dev \
libsasl2-dev \
pkg-config \
python \
wget \
@@ -9,6 +9,23 @@ kafka Repeater
### build

```bash
apt-get update && apt-get install -y \
autoconf \
automake \
build-essential \
cmake \
libboost-all-dev \
libconfig++-dev \
libgoogle-glog-dev \
libssl-dev \
libtool \
libzookeeper-mt-dev \
libsasl2-dev \
pkg-config \
python \
wget \
zlib1g-dev
mkdir build
cd build
cmake ..

0 comments on commit 90a5d63

Please sign in to comment.
You can’t perform that action at this time.