mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
cmake: Improved build. [#METR-21516]
This commit is contained in:
parent
cdd08c21ec
commit
ca5c1dc31b
@ -3,7 +3,7 @@ cmake_minimum_required (VERSION 2.6)
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
# Require at least gcc 5
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5 AND NOT CMAKE_VERSION VERSION_LESS 2.8.9)
|
||||
message (FATAL_ERROR "GCC version must be at least 5! For example, if GCC 5 is available under gcc-5, g++-5 names, do the following: export CC=gcc-5 CXX=g++-5; rm -rf CMakeCache.txt CMakeFiles; and re run cmake or ./release.")
|
||||
endif ()
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
@ -19,8 +19,8 @@ if (APPLE)
|
||||
set (APPLE_EXTRA_CXX_FLAG "-Dexp10=__exp10") # Also needed for libc++
|
||||
endif ()
|
||||
|
||||
cmake_policy(SET CMP0014 OLD) # Ignore warning about CMakeLists.txt in each directory
|
||||
cmake_policy(SET CMP0012 NEW) # Don't dereference TRUE and FALSE
|
||||
cmake_policy (SET CMP0014 OLD) # Ignore warning about CMakeLists.txt in each directory
|
||||
cmake_policy (SET CMP0012 NEW) # Don't dereference TRUE and FALSE
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
message (STATUS "CMAKE_BUILD_TYPE is not set, set to default = RELWITHDEBINFO")
|
||||
@ -96,7 +96,7 @@ set (CMAKE_C_FLAGS_DEBUG "-O0 -g3 -ggdb3 -fno-inline")
|
||||
|
||||
if (NOT APPLE)
|
||||
set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ ${GLIBC_COMPATIBILITY_LINK_FLAGS} ${CXX11_ABI}")
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
# -fuse-ld=gold - fix linkage for gcc-5.4, gcc-6.1
|
||||
# See more in http://stackoverflow.com/questions/37603238/fsanitize-not-using-gold-linker-in-gcc-6-1
|
||||
@ -155,17 +155,6 @@ include_directories (${ClickHouse_SOURCE_DIR}/libs/libzkutil/include/)
|
||||
|
||||
include_directories (${ClickHouse_SOURCE_DIR}/dbms/include)
|
||||
|
||||
include_directories (/usr/local/include/glib-2.0/)
|
||||
include_directories (/usr/local/lib/glib-2.0/include/)
|
||||
include_directories (/usr/include/glib-2.0/)
|
||||
include_directories (/usr/lib64/glib-2.0/include/)
|
||||
|
||||
if (AARCH64)
|
||||
include_directories (/usr/lib/aarch64-linux-gnu/glib-2.0/include/)
|
||||
else ()
|
||||
include_directories (/usr/lib/x86_64-linux-gnu/glib-2.0/include/)
|
||||
endif ()
|
||||
|
||||
include_directories (/usr/local/include/)
|
||||
|
||||
link_directories (/usr/local/lib)
|
||||
@ -174,6 +163,7 @@ include (cmake/find_openssl.cmake)
|
||||
include (cmake/find_icu4c.cmake)
|
||||
include (cmake/find_boost.cmake)
|
||||
include (cmake/find_libtool.cmake)
|
||||
include (cmake/find_libmysqlclient.cmake)
|
||||
|
||||
# Directory for Yandex specific files
|
||||
set (CLICKHOUSE_PRIVATE_DIR ${ClickHouse_SOURCE_DIR}/private/)
|
||||
|
39
cmake/find_glib.cmake
Normal file
39
cmake/find_glib.cmake
Normal file
@ -0,0 +1,39 @@
|
||||
set (GLIB_HINTS "/usr/local/opt/glib/lib")
|
||||
set (GLIB_INCLUDE_HINTS
|
||||
"/usr/local/include/glib-2.0/"
|
||||
"/usr/local/lib/glib-2.0/include/"
|
||||
"/usr/include/glib-2.0/"
|
||||
"/usr/lib64/glib-2.0/include/")
|
||||
if (AARCH64)
|
||||
set (GLIB_INCLUDE_HINTS ${GLIB_INCLUDE_HINTS} "/usr/lib/aarch64-linux-gnu/glib-2.0/include/")
|
||||
else ()
|
||||
set (GLIB_INCLUDE_HINTS ${GLIB_INCLUDE_HINTS} "/usr/lib/x86_64-linux-gnu/glib-2.0/include/")
|
||||
endif ()
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
find_library (GLIB_LIB libglib-2.0.a HINTS ${GLIB_HINTS})
|
||||
else ()
|
||||
find_library (GLIB_LIB glib-2.0 HINTS ${GLIB_HINTS})
|
||||
endif ()
|
||||
find_path (GLIB_INCLUDE_DIR NAMES glib.h HINTS ${GLIB_INCLUDE_HINTS})
|
||||
find_path (GLIB_CONFIG_INCLUDE_DIR NAMES glibconfig.h HINTS ${GLIB_INCLUDE_HINTS})
|
||||
include_directories (${GLIB_INCLUDE_DIR})
|
||||
include_directories (${GLIB_CONFIG_INCLUDE_DIR})
|
||||
if (APPLE)
|
||||
set (INTL_HINTS "/usr/local/opt/gettext/lib")
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
find_library (INTL_LIB libintl.a HINTS ${INTL_HINTS})
|
||||
else ()
|
||||
find_library (INTL_LIB intl HINTS ${INTL_HINTS})
|
||||
endif ()
|
||||
set (ICONV_HINTS "/usr/local/opt/libiconv/lib")
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
find_library (ICONV_LIB libiconv.a HINTS ${ICONV_HINTS})
|
||||
else ()
|
||||
find_library (ICONV_LIB iconv HINTS ${ICONV_HINTS})
|
||||
endif ()
|
||||
find_library (CORE_FOUNDATION_LIB CoreFoundation)
|
||||
find_library (CARBON_LIB Carbon)
|
||||
set (GLIB_LIBS ${GLIB_LIB} ${INTL_LIB} ${ICONV_LIB} ${CORE_FOUNDATION_LIB} ${CARBON_LIB})
|
||||
else (APPLE)
|
||||
set (GLIB_LIBS ${GLIB_LIB})
|
||||
endif (APPLE)
|
9
cmake/find_libmysqlclient.cmake
Normal file
9
cmake/find_libmysqlclient.cmake
Normal file
@ -0,0 +1,9 @@
|
||||
set (MYSQL_HINTS "/usr/local/opt/mysql/lib")
|
||||
set (MYSQL_INCLUDE_HINTS "/usr/local/opt/mysql/include")
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
find_library (STATIC_MYSQLCLIENT_LIB libmysqlclient.a HINTS ${MYSQL_HINTS})
|
||||
else ()
|
||||
find_library (MYSQLCLIENT_LIB mysqlclient HINTS ${MYSQL_HINTS})
|
||||
endif ()
|
||||
find_path (MYSQL_INCLUDE_DIR NAMES mysql.h PATH_SUFFIXES mysql HINTS ${MYSQL_INCLUDE_HINTS})
|
||||
include_directories (${MYSQL_INCLUDE_DIR})
|
@ -3,6 +3,19 @@ if (APPLE)
|
||||
set (OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
|
||||
endif ()
|
||||
find_package (OpenSSL)
|
||||
if (NOT OPENSSL_FOUND)
|
||||
message (SEND_ERROR "OpenSSL is required")
|
||||
if (OPENSSL_FOUND)
|
||||
include_directories (${OPENSSL_INCLUDE_DIR})
|
||||
endif ()
|
||||
if (NOT OPENSSL_FOUND)
|
||||
# Try to find manually.
|
||||
include_directories ("/usr/local/opt/openssl/include")
|
||||
set (OPENSSL_HINTS "/usr/local/opt/openssl/lib")
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
find_library (OPENSSL_SSL_LIBRARY libssl.a HINTS ${OPENSSL_HINTS})
|
||||
find_library (OPENSSL_CRYPTO_LIBRARY libcrypto.a HINTS ${OPENSSL_HINTS})
|
||||
else ()
|
||||
find_library (OPENSSL_SSL_LIBRARY ssl HINTS ${OPENSSL_HINTS})
|
||||
find_library (OPENSSL_CRYPTO_LIBRARY crypto HINTS ${OPENSSL_HINTS})
|
||||
endif ()
|
||||
set (OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
|
||||
endif ()
|
||||
|
@ -5,8 +5,8 @@ cmake_minimum_required(VERSION 2.8.0)
|
||||
# POCO_UNBUNDLED
|
||||
# POCO_NO_LOCALE
|
||||
#
|
||||
# ENABLE_{COMPONENT}
|
||||
# ENABLE_TESTS
|
||||
# POCO_ENABLE_{COMPONENT}
|
||||
# POCO_ENABLE_TESTS
|
||||
|
||||
project(Poco)
|
||||
|
||||
@ -68,30 +68,30 @@ set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
|
||||
include(PocoMacros)
|
||||
|
||||
# Allow enabling and disabling components
|
||||
option(ENABLE_XML "Enable the XML" ON)
|
||||
option(ENABLE_JSON "Enable the JSON" ON)
|
||||
option(ENABLE_MONGODB "Enable MongoDB" ON)
|
||||
option(ENABLE_PDF "Enable PDF" OFF)
|
||||
option(ENABLE_UTIL "Enable Util" ON)
|
||||
option(ENABLE_NET "Enable Net" ON)
|
||||
option(ENABLE_NETSSL "Enable NetSSL" ON)
|
||||
option(ENABLE_NETSSL_WIN "Enable NetSSL Windows" OFF)
|
||||
option(ENABLE_CRYPTO "Enable Crypto" ON)
|
||||
option(ENABLE_DATA "Enable Data" ON)
|
||||
option(ENABLE_DATA_SQLITE "Enable Data SQlite" OFF)
|
||||
option(ENABLE_DATA_MYSQL "Enable Data MySQL" OFF)
|
||||
option(ENABLE_DATA_ODBC "Enable Data ODBC" ON)
|
||||
option(ENABLE_SEVENZIP "Enable SevenZip" OFF)
|
||||
option(ENABLE_ZIP "Enable Zip" ON)
|
||||
option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF)
|
||||
option(ENABLE_CPPPARSER "Enable C++ parser" OFF)
|
||||
option(ENABLE_POCODOC "Enable Poco Documentation Generator" OFF)
|
||||
option(ENABLE_PAGECOMPILER "Enable PageCompiler" ON)
|
||||
option(ENABLE_PAGECOMPILER_FILE2PAGE "Enable File2Page" ON)
|
||||
option(POCO_ENABLE_XML "Enable the XML" ON)
|
||||
option(POCO_ENABLE_JSON "Enable the JSON" ON)
|
||||
option(POCO_ENABLE_MONGODB "Enable MongoDB" ON)
|
||||
option(POCO_ENABLE_PDF "Enable PDF" OFF)
|
||||
option(POCO_ENABLE_UTIL "Enable Util" ON)
|
||||
option(POCO_ENABLE_NET "Enable Net" ON)
|
||||
option(POCO_ENABLE_NETSSL "Enable NetSSL" ON)
|
||||
option(POCO_ENABLE_NETSSL_WIN "Enable NetSSL Windows" OFF)
|
||||
option(POCO_ENABLE_CRYPTO "Enable Crypto" ON)
|
||||
option(POCO_ENABLE_DATA "Enable Data" ON)
|
||||
option(POCO_ENABLE_DATA_SQLITE "Enable Data SQlite" OFF)
|
||||
option(POCO_ENABLE_DATA_MYSQL "Enable Data MySQL" OFF)
|
||||
option(POCO_ENABLE_DATA_ODBC "Enable Data ODBC" ON)
|
||||
option(POCO_ENABLE_SEVENZIP "Enable SevenZip" OFF)
|
||||
option(POCO_ENABLE_ZIP "Enable Zip" ON)
|
||||
option(POCO_ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF)
|
||||
option(POCO_ENABLE_CPPPARSER "Enable C++ parser" OFF)
|
||||
option(POCO_ENABLE_POCODOC "Enable Poco Documentation Generator" OFF)
|
||||
option(POCO_ENABLE_PAGECOMPILER "Enable PageCompiler" ON)
|
||||
option(POCO_ENABLE_PAGECOMPILER_FILE2PAGE "Enable File2Page" ON)
|
||||
|
||||
option(FORCE_OPENSSL "Force usage of OpenSSL even under windows" OFF)
|
||||
|
||||
option(ENABLE_TESTS
|
||||
option(POCO_ENABLE_TESTS
|
||||
"Set to OFF|ON (default is OFF) to control build of POCO tests & samples" OFF)
|
||||
|
||||
option(POCO_STATIC
|
||||
@ -110,7 +110,7 @@ else (POCO_STATIC)
|
||||
message(STATUS "Building dynamic libraries")
|
||||
endif (POCO_STATIC)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
include(CTest)
|
||||
enable_testing()
|
||||
message(STATUS "Building with unittests & samples")
|
||||
@ -183,32 +183,32 @@ endif (ANDROID)
|
||||
# Collect the built libraries and include dirs, the will be used to create the PocoConfig.cmake file
|
||||
set (Poco_COMPONENTS "")
|
||||
|
||||
#if (ENABLE_TESTS)
|
||||
# add_subdirectory (CppUnit)
|
||||
#endif ()
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory (CppUnit)
|
||||
endif ()
|
||||
|
||||
add_subdirectory (Foundation)
|
||||
if (ENABLE_XML)
|
||||
if (POCO_ENABLE_XML)
|
||||
add_subdirectory (XML)
|
||||
list (APPEND Poco_COMPONENTS "XML")
|
||||
endif ()
|
||||
if (ENABLE_JSON)
|
||||
if (POCO_ENABLE_JSON)
|
||||
add_subdirectory (JSON)
|
||||
list (APPEND Poco_COMPONENTS "JSON")
|
||||
endif ()
|
||||
if (ENABLE_MONGODB)
|
||||
if (POCO_ENABLE_MONGODB)
|
||||
add_subdirectory (MongoDB)
|
||||
list (APPEND Poco_COMPONENTS "MongoDB")
|
||||
endif ()
|
||||
if (ENABLE_PDF)
|
||||
if (POCO_ENABLE_PDF)
|
||||
add_subdirectory (PDF)
|
||||
list (APPEND Poco_COMPONENTS "PDF")
|
||||
endif()
|
||||
if (ENABLE_UTIL)
|
||||
if (POCO_ENABLE_UTIL)
|
||||
add_subdirectory (Util)
|
||||
list (APPEND Poco_COMPONENTS "Util")
|
||||
endif ()
|
||||
if (ENABLE_NET)
|
||||
if (POCO_ENABLE_NET)
|
||||
add_subdirectory (Net)
|
||||
list (APPEND Poco_COMPONENTS "Net")
|
||||
endif ()
|
||||
@ -217,33 +217,33 @@ endif ()
|
||||
#NetSSL
|
||||
|
||||
|
||||
if(WIN32 AND ENABLE_NETSSL_WIN)
|
||||
if(WIN32 AND POCO_ENABLE_NETSSL_WIN)
|
||||
add_subdirectory(NetSSL_Win)
|
||||
list(APPEND Poco_COMPONENTS "NetSSL_Win")
|
||||
endif(WIN32 AND ENABLE_NETSSL_WIN)
|
||||
endif(WIN32 AND POCO_ENABLE_NETSSL_WIN)
|
||||
|
||||
find_package(OpenSSL)
|
||||
if(OPENSSL_FOUND)
|
||||
include_directories("${OPENSSL_INCLUDE_DIR}")
|
||||
if(ENABLE_NETSSL)
|
||||
if(POCO_ENABLE_NETSSL)
|
||||
add_subdirectory(NetSSL_OpenSSL)
|
||||
list(APPEND Poco_COMPONENTS "NetSSL_OpenSSL")
|
||||
endif()
|
||||
if(ENABLE_CRYPTO)
|
||||
if(POCO_ENABLE_CRYPTO)
|
||||
add_subdirectory(Crypto)
|
||||
list(APPEND Poco_COMPONENTS "Crypto")
|
||||
endif()
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
if(ENABLE_DATA)
|
||||
if(POCO_ENABLE_DATA)
|
||||
add_subdirectory(Data)
|
||||
list(APPEND Poco_COMPONENTS "Data")
|
||||
endif()
|
||||
if(ENABLE_SEVENZIP)
|
||||
if(POCO_ENABLE_SEVENZIP)
|
||||
add_subdirectory(SevenZip)
|
||||
list(APPEND Poco_COMPONENTS "SevenZip")
|
||||
endif()
|
||||
if(ENABLE_ZIP)
|
||||
if(POCO_ENABLE_ZIP)
|
||||
add_subdirectory(Zip)
|
||||
list(APPEND Poco_COMPONENTS "Zip")
|
||||
endif()
|
||||
@ -252,28 +252,28 @@ find_package(APR)
|
||||
find_package(Apache2)
|
||||
if(APRUTIL_FOUND AND APACHE_FOUND)
|
||||
include_directories( "${APACHE_INCLUDE_DIR}" "${APRUTIL_INCLUDE_DIR}" )
|
||||
if(ENABLE_APACHECONNECTOR)
|
||||
if(POCO_ENABLE_APACHECONNECTOR)
|
||||
add_subdirectory(ApacheConnector)
|
||||
list(APPEND Poco_COMPONENTS "ApacheConnector")
|
||||
endif()
|
||||
endif(APRUTIL_FOUND AND APACHE_FOUND)
|
||||
|
||||
if(ENABLE_CPPPARSER)
|
||||
if(POCO_ENABLE_CPPPARSER)
|
||||
add_subdirectory(CppParser)
|
||||
list(APPEND Poco_COMPONENTS "CppParser")
|
||||
endif()
|
||||
|
||||
if(ENABLE_POCODOC)
|
||||
if(POCO_ENABLE_POCODOC)
|
||||
add_subdirectory(PocoDoc)
|
||||
list(APPEND Poco_COMPONENTS "PocoDoc")
|
||||
endif()
|
||||
|
||||
if(ENABLE_PAGECOMPILER)
|
||||
if(POCO_ENABLE_PAGECOMPILER)
|
||||
add_subdirectory(PageCompiler)
|
||||
list(APPEND Poco_COMPONENTS "PageCompiler")
|
||||
endif()
|
||||
|
||||
if(ENABLE_PAGECOMPILER_FILE2PAGE)
|
||||
if(POCO_ENABLE_PAGECOMPILER_FILE2PAGE)
|
||||
add_subdirectory(PageCompiler/File2Page)
|
||||
list(APPEND Poco_COMPONENTS "File2Page")
|
||||
endif()
|
||||
|
@ -21,7 +21,7 @@ set_target_properties( "${LIBNAME}"
|
||||
|
||||
target_link_libraries( "${LIBNAME}" PocoFoundation ${OPENSSL_LIBRARIES} )
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
@ -28,7 +28,7 @@ set_target_properties( "${LIBNAME}"
|
||||
|
||||
target_link_libraries( "${LIBNAME}" PocoFoundation)
|
||||
|
||||
if(ENABLE_DATA_MYSQL)
|
||||
if(POCO_ENABLE_DATA_MYSQL)
|
||||
find_package(MySQL)
|
||||
if(MYSQL_FOUND)
|
||||
include_directories("${MYSQL_INCLUDE_DIR}")
|
||||
@ -37,9 +37,9 @@ if(ENABLE_DATA_MYSQL)
|
||||
else()
|
||||
message(STATUS "MySQL Support Disabled - no MySQL library")
|
||||
endif(MYSQL_FOUND)
|
||||
endif(ENABLE_DATA_MYSQL)
|
||||
endif(POCO_ENABLE_DATA_MYSQL)
|
||||
|
||||
if(ENABLE_DATA_ODBC)
|
||||
if(POCO_ENABLE_DATA_ODBC)
|
||||
find_package(ODBC)
|
||||
if(WIN32 AND NOT WINCE)
|
||||
set(ODBC_LIBRARIES "odbc32" "odbccp32")
|
||||
@ -54,9 +54,9 @@ if(ENABLE_DATA_ODBC)
|
||||
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
||||
endif()
|
||||
endif(WIN32 AND NOT WINCE)
|
||||
endif(ENABLE_DATA_ODBC)
|
||||
endif(POCO_ENABLE_DATA_ODBC)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
@ -21,6 +21,6 @@ set_target_properties( "${LIBNAME}"
|
||||
|
||||
target_link_libraries( "${LIBNAME}" PocoFoundation PocoData ${MYSQL_LIB})
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
@ -21,6 +21,6 @@ set_target_properties( "${LIBNAME}"
|
||||
|
||||
target_link_libraries( "${LIBNAME}" PocoFoundation PocoData ${ODBC_LIBRARIES})
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
@ -114,7 +114,7 @@ set_target_properties( "${LIBNAME}"
|
||||
|
||||
target_link_libraries( "${LIBNAME}" ${SYSLIBS})
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory( samples )
|
||||
add_subdirectory( testsuite )
|
||||
endif ()
|
||||
|
@ -19,7 +19,7 @@ set_target_properties( "${LIBNAME}"
|
||||
|
||||
target_link_libraries( "${LIBNAME}" PocoFoundation)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
@ -19,7 +19,7 @@ set_target_properties( "${LIBNAME}"
|
||||
|
||||
target_link_libraries( "${LIBNAME}" PocoNet PocoFoundation)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
@ -30,7 +30,7 @@ set_target_properties( "${LIBNAME}"
|
||||
|
||||
target_link_libraries( "${LIBNAME}" PocoFoundation ${SYSLIBS})
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
@ -19,7 +19,7 @@ set_target_properties( "${LIBNAME}"
|
||||
|
||||
target_link_libraries( "${LIBNAME}" PocoCrypto PocoNet PocoUtil PocoFoundation ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} )
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
@ -24,18 +24,18 @@ set_target_properties( "${LIBNAME}"
|
||||
)
|
||||
|
||||
target_link_libraries( "${LIBNAME}" PocoFoundation)
|
||||
if (ENABLE_XML)
|
||||
if (POCO_ENABLE_XML)
|
||||
target_link_libraries( "${LIBNAME}" PocoXML)
|
||||
else ()
|
||||
add_definitions( -DPOCO_UTIL_NO_XMLCONFIGURATION )
|
||||
endif()
|
||||
if (ENABLE_JSON)
|
||||
if (POCO_ENABLE_JSON)
|
||||
target_link_libraries( "${LIBNAME}" PocoJSON)
|
||||
else ()
|
||||
add_definitions( -DPOCO_UTIL_NO_JSONCONFIGURATION )
|
||||
endif()
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
@ -42,7 +42,7 @@ set_target_properties( "${LIBNAME}"
|
||||
|
||||
target_link_libraries( "${LIBNAME}" ${SYSLIBS} PocoFoundation)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
@ -19,7 +19,7 @@ set_target_properties( "${LIBNAME}"
|
||||
|
||||
target_link_libraries( "${LIBNAME}" PocoUtil PocoXML PocoFoundation)
|
||||
|
||||
if (ENABLE_TESTS)
|
||||
if (POCO_ENABLE_TESTS)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(testsuite)
|
||||
endif ()
|
||||
|
@ -111,7 +111,7 @@ This is rarely used but enabled by default.
|
||||
|
||||
If you don't need it, you could set variable and skip installation step:
|
||||
```
|
||||
export DISABLE_MONGODB=1
|
||||
export ENABLE_MONGODB=0
|
||||
```
|
||||
|
||||
Otherwise:
|
||||
|
@ -54,7 +54,7 @@ export CXX=g++-6
|
||||
|
||||
## Disable MongoDB binding
|
||||
```
|
||||
export DISABLE_MONGODB=1
|
||||
export ENABLE_MONGODB=0
|
||||
```
|
||||
|
||||
## Detect number of threads
|
||||
|
@ -33,7 +33,7 @@ https://github.com/yandex/ClickHouse/blob/master/doc/build.md
|
||||
|
||||
Install required packages. After that let's run the following command from directory with source code of ClickHouse:
|
||||
```
|
||||
~/ClickHouse$ DISABLE_MONGODB=1 ./release --standalone
|
||||
~/ClickHouse$ ENABLE_MONGODB=0 ./release --standalone
|
||||
```
|
||||
|
||||
The build successfully completed:
|
||||
|
@ -33,7 +33,7 @@ https://github.com/yandex/ClickHouse/blob/master/doc/build.md
|
||||
|
||||
Установим необходимые пакеты. После этого выполним следующую команду из директории с исходными кодами ClickHouse:
|
||||
```
|
||||
~/ClickHouse$ DISABLE_MONGODB=1 ./release --standalone
|
||||
~/ClickHouse$ ENABLE_MONGODB=0 ./release --standalone
|
||||
```
|
||||
|
||||
Сборка успешно завершена:
|
||||
|
@ -82,31 +82,7 @@ else ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set (GLIB_HINTS "/usr/local/opt/glib/lib")
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
find_library (GLIB_LIB libglib-2.0.a HINTS ${GLIB_HINTS})
|
||||
else ()
|
||||
find_library (GLIB_LIB glib-2.0 HINTS ${GLIB_HINTS})
|
||||
endif ()
|
||||
if (APPLE)
|
||||
set (INTL_HINTS "/usr/local/opt/gettext/lib")
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
find_library (INTL_LIB libintl.a HINTS ${INTL_HINTS})
|
||||
else ()
|
||||
find_library (INTL_LIB intl HINTS ${INTL_HINTS})
|
||||
endif ()
|
||||
set (ICONV_HINTS "/usr/local/opt/libiconv/lib")
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
find_library (ICONV_LIB libiconv.a HINTS ${ICONV_HINTS})
|
||||
else ()
|
||||
find_library (ICONV_LIB iconv HINTS ${ICONV_HINTS})
|
||||
endif ()
|
||||
find_library (CORE_FOUNDATION_LIB CoreFoundation)
|
||||
find_library (CARBON_LIB Carbon)
|
||||
set (GLIB_LIBS ${GLIB_LIB} ${INTL_LIB} ${ICONV_LIB} ${CORE_FOUNDATION_LIB} ${CARBON_LIB})
|
||||
else (APPLE)
|
||||
set (GLIB_LIBS ${GLIB_LIB})
|
||||
endif (APPLE)
|
||||
include (${ClickHouse_SOURCE_DIR}/cmake/find_glib.cmake)
|
||||
|
||||
target_link_libraries (
|
||||
common
|
||||
|
@ -26,13 +26,6 @@ add_library (mysqlxx
|
||||
|
||||
add_dependencies (mysqlxx common)
|
||||
|
||||
set (MYSQL_HINTS "/usr/local/opt/mysql/lib")
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
find_library (STATIC_MYSQLCLIENT_LIB libmysqlclient.a HINTS ${MYSQL_HINTS})
|
||||
else ()
|
||||
find_library (MYSQLCLIENT_LIB mysqlclient HINTS ${MYSQL_HINTS})
|
||||
endif ()
|
||||
|
||||
set (Z_HINTS "/usr/local/opt/zlib/lib")
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
find_library (Z_LIB libz.a HINTS ${Z_HINTS})
|
||||
@ -43,13 +36,13 @@ endif ()
|
||||
if (USE_STATIC_LIBRARIES)
|
||||
set (MYSQLCLIENT_LIB ${CMAKE_CURRENT_BINARY_DIR}/libmysqlclient.a)
|
||||
target_link_libraries (mysqlxx common ${MYSQLCLIENT_LIB} ${OPENSSL_LIBRARIES} ${Z_LIB} dl)
|
||||
add_custom_command(
|
||||
add_custom_command (
|
||||
OUTPUT ${MYSQLCLIENT_LIB}
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/patch.sh ${STATIC_MYSQLCLIENT_LIB} ${MYSQLCLIENT_LIB}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Patching mysqlclient library.")
|
||||
add_custom_target(our_mysql_client DEPENDS ${MYSQLCLIENT_LIB})
|
||||
add_dependencies(mysqlxx our_mysql_client)
|
||||
add_custom_target (our_mysql_client DEPENDS ${MYSQLCLIENT_LIB})
|
||||
add_dependencies (mysqlxx our_mysql_client)
|
||||
endif ()
|
||||
|
||||
target_link_libraries (mysqlxx common ${MYSQLCLIENT_LIB} ${OPENSSL_LIBRARIES} ${Z_LIB} dl)
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <sstream>
|
||||
#include <mysql/mysql.h>
|
||||
#include <mysql.h>
|
||||
|
||||
#include <Poco/Exception.h>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <list>
|
||||
#include <memory>
|
||||
|
||||
#include <mysql/mysqld_error.h>
|
||||
#include <mysqld_error.h>
|
||||
|
||||
#include <Poco/Util/Application.h>
|
||||
#include <Poco/Util/LayeredConfiguration.h>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <mysql/mysql.h>
|
||||
#include <mysql.h>
|
||||
#include <Poco/Types.h>
|
||||
|
||||
#include <common/LocalDate.h>
|
||||
|
@ -4,9 +4,9 @@ add_executable (mysqlxx_test mysqlxx_test.cpp)
|
||||
add_executable (failover failover.cpp)
|
||||
|
||||
if (APPLE)
|
||||
SET(RT_LIBRARIES "")
|
||||
set (RT_LIBRARIES "")
|
||||
else()
|
||||
SET(RT_LIBRARIES "rt")
|
||||
set (RT_LIBRARIES "rt")
|
||||
endif()
|
||||
target_link_libraries (mysqlxx_test mysqlxx dbms ${RT_LIBRARIES})
|
||||
target_link_libraries (failover mysqlxx PocoUtil PocoFoundation)
|
||||
target_link_libraries (failover mysqlxx PocoUtil PocoFoundation ${RT_LIBRARIES})
|
||||
|
2
release
2
release
@ -51,7 +51,7 @@ make_control "$CONTROL" "$DAEMONS"
|
||||
gen_changelog "$REVISION" "$CHDATE" "$AUTHOR" "$CHLOG" "$DAEMONS"
|
||||
|
||||
# Build (only binary packages).
|
||||
debuild -e DAEMONS="${DAEMONS}" -e DISABLE_MONGODB -e GLIBC_COMPATIBILITY -e CC -e CXX -b ${DEBUILD_NOSIGN_OPTIONS}
|
||||
debuild -e DAEMONS="${DAEMONS}" -e ENABLE_MONGODB -e GLIBC_COMPATIBILITY -e CC -e CXX -b ${DEBUILD_NOSIGN_OPTIONS}
|
||||
|
||||
if [[ $STANDALONE != 'yes' ]]
|
||||
then
|
||||
|
Loading…
Reference in New Issue
Block a user