2017-06-16 16:20:51 +00:00
|
|
|
# 'clickhouse' binary is a multi purpose tool,
|
|
|
|
# that contain multiple execution modes (client, server, etc.)
|
|
|
|
# each of them is built and linked as a separate library, defined below.
|
|
|
|
|
2017-12-09 16:36:03 +00:00
|
|
|
add_library (clickhouse-server-lib
|
2017-08-09 14:33:07 +00:00
|
|
|
ConfigReloader.cpp
|
2017-04-01 07:20:54 +00:00
|
|
|
HTTPHandler.cpp
|
|
|
|
InterserverIOHTTPHandler.cpp
|
|
|
|
MetricsTransmitter.cpp
|
2017-08-09 14:33:07 +00:00
|
|
|
NotFoundHandler.cpp
|
|
|
|
PingRequestHandler.cpp
|
|
|
|
ReplicasStatusHandler.cpp
|
|
|
|
RootRequestHandler.cpp
|
|
|
|
Server.cpp
|
2017-04-01 07:20:54 +00:00
|
|
|
StatusFile.cpp
|
2017-08-09 14:33:07 +00:00
|
|
|
TCPHandler.cpp
|
|
|
|
)
|
|
|
|
|
2017-12-09 16:36:03 +00:00
|
|
|
target_link_libraries (clickhouse-server-lib clickhouse_common_io daemon clickhouse_storages_system clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions)
|
|
|
|
target_include_directories (clickhouse-server-lib PUBLIC ${ClickHouse_SOURCE_DIR}/libs/libdaemon/include)
|
2016-02-07 21:58:58 +00:00
|
|
|
|
2017-12-09 16:36:03 +00:00
|
|
|
add_library (clickhouse-local-lib LocalServer.cpp)
|
|
|
|
target_link_libraries (clickhouse-local-lib clickhouse-server-lib clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions)
|
2016-02-07 21:58:58 +00:00
|
|
|
|
2017-12-09 16:36:03 +00:00
|
|
|
add_library (clickhouse-extract-from-config-lib ${SPLIT_SHARED} ExtractFromConfig.cpp)
|
|
|
|
target_link_libraries (clickhouse-extract-from-config-lib clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
2017-03-24 15:05:54 +00:00
|
|
|
|
2017-12-09 16:36:03 +00:00
|
|
|
add_library (clickhouse-client-lib Client.cpp)
|
2017-12-09 21:55:10 +00:00
|
|
|
target_link_libraries (clickhouse-client-lib clickhouse_functions clickhouse_aggregate_functions clickhouse_table_functions ${LINE_EDITING_LIBS} ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
2017-06-16 16:20:51 +00:00
|
|
|
install (FILES clickhouse-client.xml DESTINATION ${CLICKHOUSE_ETC_DIR}/clickhouse-client COMPONENT clickhouse-client RENAME config.xml)
|
|
|
|
|
2017-12-09 16:36:03 +00:00
|
|
|
add_library (clickhouse-benchmark-lib ${SPLIT_SHARED} Benchmark.cpp)
|
|
|
|
target_link_libraries (clickhouse-benchmark-lib clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
|
|
|
target_include_directories (clickhouse-benchmark-lib PRIVATE ${PCG_RANDOM_INCLUDE_DIR})
|
2017-06-16 16:20:51 +00:00
|
|
|
|
2017-12-09 16:36:03 +00:00
|
|
|
add_library (clickhouse-performance-test-lib ${SPLIT_SHARED} PerformanceTest.cpp)
|
|
|
|
target_link_libraries (clickhouse-performance-test-lib clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
|
|
|
target_include_directories (clickhouse-performance-test-lib PRIVATE ${PCG_RANDOM_INCLUDE_DIR})
|
2017-06-16 16:20:51 +00:00
|
|
|
|
2017-11-24 18:08:01 +00:00
|
|
|
add_library (clickhouse-compressor-lib ${SPLIT_SHARED} Compressor.cpp)
|
|
|
|
target_link_libraries (clickhouse-compressor-lib clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
2017-09-20 14:12:12 +00:00
|
|
|
|
2017-12-09 16:36:03 +00:00
|
|
|
add_library (clickhouse-format-lib ${SPLIT_SHARED} Format.cpp)
|
|
|
|
target_link_libraries (clickhouse-format-lib clickhouse_common_io ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
2017-11-11 01:04:14 +00:00
|
|
|
|
2017-11-12 17:08:52 +00:00
|
|
|
if (USE_EMBEDDED_COMPILER)
|
|
|
|
link_directories (${LLVM_LIBRARY_DIRS})
|
2017-12-09 21:55:10 +00:00
|
|
|
add_subdirectory ("Compiler-${LLVM_VERSION}")
|
2017-11-12 17:08:52 +00:00
|
|
|
endif ()
|
|
|
|
|
2017-12-09 21:55:10 +00:00
|
|
|
if (CLICKHOUSE_SPLIT_BINARY)
|
|
|
|
add_executable (clickhouse-server clickhouse-server.cpp)
|
|
|
|
target_link_libraries (clickhouse-server clickhouse-server-lib)
|
|
|
|
add_executable (clickhouse-client clickhouse-client.cpp)
|
|
|
|
target_link_libraries (clickhouse-client clickhouse-client-lib)
|
|
|
|
add_executable (clickhouse-local clickhouse-local.cpp)
|
|
|
|
target_link_libraries (clickhouse-local clickhouse-local-lib)
|
|
|
|
add_executable (clickhouse-benchmark clickhouse-benchmark.cpp)
|
|
|
|
target_link_libraries (clickhouse-benchmark clickhouse-benchmark-lib clickhouse_aggregate_functions)
|
|
|
|
add_executable (clickhouse-performance-test clickhouse-performance-test.cpp)
|
2017-12-11 12:38:34 +00:00
|
|
|
target_link_libraries (clickhouse-performance-test clickhouse-performance-test-lib dbms)
|
2017-12-09 21:55:10 +00:00
|
|
|
add_executable (clickhouse-extract-from-config clickhouse-extract-from-config.cpp)
|
|
|
|
target_link_libraries (clickhouse-extract-from-config clickhouse-extract-from-config-lib)
|
|
|
|
# now in utils
|
|
|
|
#add_executable (clickhouse-compressor clickhouse-compressor.cpp)
|
|
|
|
#target_link_libraries (clickhouse-compressor clickhouse-compressor-lib)
|
|
|
|
add_executable (clickhouse-format clickhouse-format.cpp)
|
|
|
|
target_link_libraries (clickhouse-format clickhouse-format-lib dbms)
|
|
|
|
|
2017-12-13 19:07:12 +00:00
|
|
|
set (CLICKHOUSE_ALL_TARGETS clickhouse-server clickhouse-client clickhouse-local clickhouse-benchmark clickhouse-performance-test clickhouse-format)
|
|
|
|
|
2017-12-09 21:55:10 +00:00
|
|
|
if (USE_EMBEDDED_COMPILER)
|
|
|
|
add_executable (clickhouse-clang clickhouse-clang.cpp)
|
|
|
|
target_link_libraries (clickhouse-clang clickhouse-compiler-lib)
|
|
|
|
add_executable (clickhouse-lld clickhouse-lld.cpp)
|
|
|
|
target_link_libraries (clickhouse-lld clickhouse-compiler-lib)
|
2017-12-11 17:27:22 +00:00
|
|
|
install (TARGETS clickhouse-clang clickhouse-lld RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
|
2017-12-13 19:07:12 +00:00
|
|
|
list (APPEND CLICKHOUSE_ALL_TARGETS clickhouse-clang clickhouse-lld)
|
2017-12-09 21:55:10 +00:00
|
|
|
endif ()
|
|
|
|
|
2017-12-13 19:07:12 +00:00
|
|
|
install (TARGETS clickhouse-server ${CLICKHOUSE_ALL_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
|
|
|
|
add_custom_target (clickhouse-bundle ALL DEPENDS ${CLICKHOUSE_ALL_TARGETS})
|
2017-12-09 21:55:10 +00:00
|
|
|
else ()
|
2017-12-11 12:38:34 +00:00
|
|
|
add_executable (clickhouse main.cpp)
|
|
|
|
target_include_directories (clickhouse BEFORE PRIVATE ${COMMON_INCLUDE_DIR})
|
|
|
|
target_link_libraries (clickhouse
|
|
|
|
clickhouse-server-lib
|
|
|
|
clickhouse-client-lib
|
|
|
|
clickhouse-local-lib
|
|
|
|
clickhouse-benchmark-lib
|
|
|
|
clickhouse-performance-test-lib
|
|
|
|
clickhouse-extract-from-config-lib
|
|
|
|
clickhouse-compressor-lib
|
|
|
|
clickhouse-format-lib
|
|
|
|
dbms
|
2017-11-24 18:08:01 +00:00
|
|
|
)
|
2017-11-12 12:58:40 +00:00
|
|
|
|
2017-12-11 12:38:34 +00:00
|
|
|
if (USE_EMBEDDED_COMPILER)
|
|
|
|
target_link_libraries (clickhouse clickhouse-compiler-lib)
|
|
|
|
endif ()
|
2017-11-12 12:58:40 +00:00
|
|
|
|
2017-12-11 12:38:34 +00:00
|
|
|
add_custom_target (clickhouse-server ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-server DEPENDS clickhouse)
|
|
|
|
add_custom_target (clickhouse-client ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-client DEPENDS clickhouse)
|
|
|
|
add_custom_target (clickhouse-local ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-local DEPENDS clickhouse)
|
|
|
|
add_custom_target (clickhouse-benchmark ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-benchmark DEPENDS clickhouse)
|
|
|
|
add_custom_target (clickhouse-performance-test ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-performance-test DEPENDS clickhouse)
|
|
|
|
add_custom_target (clickhouse-format ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-format DEPENDS clickhouse)
|
|
|
|
# install always because depian package want this files:
|
|
|
|
add_custom_target (clickhouse-clang ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-clang DEPENDS clickhouse)
|
|
|
|
add_custom_target (clickhouse-lld ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-lld DEPENDS clickhouse)
|
2017-12-11 17:27:22 +00:00
|
|
|
|
|
|
|
install (TARGETS clickhouse RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
|
|
|
|
install (FILES
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/clickhouse-server
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/clickhouse-client
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/clickhouse-local
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/clickhouse-benchmark
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/clickhouse-performance-test
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/clickhouse-format
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/clickhouse-clang
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/clickhouse-lld
|
|
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
|
2017-12-13 19:07:12 +00:00
|
|
|
|
|
|
|
add_custom_target (clickhouse-bundle ALL DEPENDS clickhouse)
|
2017-12-09 21:55:10 +00:00
|
|
|
endif ()
|
|
|
|
|
2017-12-09 16:36:03 +00:00
|
|
|
install (
|
2017-04-01 07:20:54 +00:00
|
|
|
FILES config.xml users.xml
|
|
|
|
DESTINATION ${CLICKHOUSE_ETC_DIR}/clickhouse-server
|
|
|
|
COMPONENT clickhouse)
|