Cmake: fix fallback to internal libs if no external found

This commit is contained in:
proller 2017-02-09 00:35:27 +03:00 committed by alexey-milovidov
parent b9a96b480d
commit a1e1e6da66
4 changed files with 8 additions and 5 deletions

View File

@ -13,6 +13,7 @@ if (NOT USE_INTERNAL_BOOST_LIBRARY)
endif ()
if (NOT Boost_SYSTEM_LIBRARY)
set (USE_INTERNAL_BOOST_LIBRARY 1)
set (Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options_internal)
set (Boost_SYSTEM_LIBRARY boost_system_internal)
set (Boost_FILESYSTEM_LIBRARY boost_filesystem_internal)

View File

@ -6,12 +6,13 @@ if (ENABLE_LIBTCMALLOC)
endif ()
if (NOT (GPERFTOOLS_INCLUDE_DIR AND GPERFTOOLS_TCMALLOC_MINIMAL))
set(GPERFTOOLS_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libtcmalloc/include")
set(GPERFTOOLS_TCMALLOC_MINIMAL tcmalloc_minimal_internal)
set (USE_INTERNAL_GPERFTOOLS_LIBRARY 1)
set (GPERFTOOLS_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libtcmalloc/include")
set (GPERFTOOLS_TCMALLOC_MINIMAL tcmalloc_minimal_internal)
include_directories (BEFORE ${GPERFTOOLS_INCLUDE_DIR})
endif ()
set (USE_TCMALLOC 1)
message(STATUS "Using tcmalloc=${USE_TCMALLOC}: ${GPERFTOOLS_INCLUDE_DIR} : ${GPERFTOOLS_TCMALLOC_MINIMAL}")
message (STATUS "Using tcmalloc=${USE_TCMALLOC}: ${GPERFTOOLS_INCLUDE_DIR} : ${GPERFTOOLS_TCMALLOC_MINIMAL}")
endif ()

View File

@ -1,12 +1,13 @@
if (NOT USE_INTERNAL_POCO_LIBRARY)
find_package (Poco REQUIRED Util Net XML Data Crypto DataODBC MongoDB Foundation)
find_package (Poco COMPONENTS Net XML Data Crypto DataODBC MongoDB)
if (Poco_INCLUDE_DIRS)
include_directories (${Poco_INCLUDE_DIRS})
endif ()
endif ()
if (NOT (Poco_INCLUDE_DIRS AND Poco_Foundation_LIBRARY AND Poco_MongoDB_LIBRARY AND Poco_DataODBC_LIBRARY))
set (USE_INTERNAL_POCO_LIBRARY 1)
set (Poco_INCLUDE_DIRS
"${ClickHouse_SOURCE_DIR}/contrib/libpoco/Foundation/include/"
"${ClickHouse_SOURCE_DIR}/contrib/libpoco/Util/include/"

View File

@ -1,12 +1,12 @@
if (NOT USE_INTERNAL_ZLIB_LIBRARY)
find_package (ZLIB)
if (ZLIB_FOUND)
include_directories (${ZLIB_INCLUDE_DIRS})
endif ()
endif ()
if (NOT ZLIB_FOUND)
set (USE_INTERNAL_ZLIB_LIBRARY 1)
set (ZLIB_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libzlib-ng")
include_directories (BEFORE ${ZLIB_INCLUDE_DIR})
if (USE_STATIC_LIBRARIES)