Cmake: fix build without downloaded submodules (#1379)

This commit is contained in:
proller 2017-10-20 20:59:44 +03:00 committed by GitHub
parent 622bd34505
commit 8dd5c9dac2
4 changed files with 22 additions and 5 deletions

View File

@ -1,5 +1,10 @@
option (USE_INTERNAL_POCO_LIBRARY "Set to FALSE to use system poco library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_POCO_LIBRARY "Set to FALSE to use system poco library instead of bundled" ${NOT_UNBUNDLED})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/poco/CMakeLists.txt")
message (WARNING "submodule contrib/poco is missing. to fix try run: \n git submodule update --init --recursive")
set (USE_INTERNAL_POCO_LIBRARY 0)
endif ()
if (NOT USE_INTERNAL_POCO_LIBRARY) if (NOT USE_INTERNAL_POCO_LIBRARY)
find_package (Poco COMPONENTS Net NetSSL XML Data Crypto DataODBC MongoDB) find_package (Poco COMPONENTS Net NetSSL XML Data Crypto DataODBC MongoDB)
endif () endif ()

View File

@ -4,6 +4,12 @@ if (ENABLE_RDKAFKA)
option (USE_INTERNAL_RDKAFKA_LIBRARY "Set to FALSE to use system librdkafka instead of the bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_RDKAFKA_LIBRARY "Set to FALSE to use system librdkafka instead of the bundled" ${NOT_UNBUNDLED})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/librdkafka/CMakeLists.txt")
message (WARNING "submodule contrib/librdkafka is missing. to fix try run: \n git submodule update --init --recursive")
set (USE_INTERNAL_RDKAFKA_LIBRARY 0)
set (MISSING_INTERNAL_RDKAFKA_LIBRARY 1)
endif ()
if (NOT USE_INTERNAL_RDKAFKA_LIBRARY) if (NOT USE_INTERNAL_RDKAFKA_LIBRARY)
find_library (RDKAFKA_LIBRARY rdkafka) find_library (RDKAFKA_LIBRARY rdkafka)
find_path (RDKAFKA_INCLUDE_DIR NAMES librdkafka/rdkafka.h PATHS ${RDKAFKA_INCLUDE_PATHS}) find_path (RDKAFKA_INCLUDE_DIR NAMES librdkafka/rdkafka.h PATHS ${RDKAFKA_INCLUDE_PATHS})
@ -11,14 +17,14 @@ endif ()
if (RDKAFKA_LIBRARY AND RDKAFKA_INCLUDE_DIR) if (RDKAFKA_LIBRARY AND RDKAFKA_INCLUDE_DIR)
include_directories (${RDKAFKA_INCLUDE_DIR}) include_directories (${RDKAFKA_INCLUDE_DIR})
else () set (USE_RDKAFKA 1)
elseif (NOT MISSING_INTERNAL_RDKAFKA_LIBRARY)
set (USE_INTERNAL_RDKAFKA_LIBRARY 1) set (USE_INTERNAL_RDKAFKA_LIBRARY 1)
set (RDKAFKA_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/librdkafka/src") set (RDKAFKA_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/librdkafka/src")
set (RDKAFKA_LIBRARY rdkafka) set (RDKAFKA_LIBRARY rdkafka)
set (USE_RDKAFKA 1)
endif () endif ()
set (USE_RDKAFKA 1)
endif () endif ()
message (STATUS "Using librdkafka=${USE_RDKAFKA}: ${RDKAFKA_INCLUDE_DIR} : ${RDKAFKA_LIBRARY}") message (STATUS "Using librdkafka=${USE_RDKAFKA}: ${RDKAFKA_INCLUDE_DIR} : ${RDKAFKA_LIBRARY}")

View File

@ -1,5 +1,10 @@
option (USE_INTERNAL_ZOOKEEPER_LIBRARY "Set to FALSE to use system zookeeper library instead of bundled" ${NOT_UNBUNDLED}) option (USE_INTERNAL_ZOOKEEPER_LIBRARY "Set to FALSE to use system zookeeper library instead of bundled" ${NOT_UNBUNDLED})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/zookeeper/src/c/CMakeLists.txt")
message (WARNING "submodule contrib/zookeeper is missing. to fix try run: \n git submodule update --init --recursive")
set (USE_INTERNAL_ZOOKEEPER_LIBRARY 0)
endif ()
if (NOT USE_INTERNAL_ZOOKEEPER_LIBRARY) if (NOT USE_INTERNAL_ZOOKEEPER_LIBRARY)
find_library (ZOOKEEPER_LIBRARY zookeeper_mt) find_library (ZOOKEEPER_LIBRARY zookeeper_mt)
find_path (ZOOKEEPER_INCLUDE_DIR NAMES zookeeper/zookeeper.h PATHS ${ZOOKEEPER_INCLUDE_PATHS}) find_path (ZOOKEEPER_INCLUDE_DIR NAMES zookeeper/zookeeper.h PATHS ${ZOOKEEPER_INCLUDE_PATHS})

View File

@ -1,10 +1,11 @@
#include <Common/isLocalAddress.h>
#include <cstring>
#include <Core/Types.h> #include <Core/Types.h>
#include <Poco/Util/Application.h> #include <Poco/Util/Application.h>
#include <Poco/Net/NetworkInterface.h> #include <Poco/Net/NetworkInterface.h>
#include <Poco/Net/SocketAddress.h> #include <Poco/Net/SocketAddress.h>
#include <Common/isLocalAddress.h>
namespace DB namespace DB
{ {