2016-02-07 21:58:58 +00:00
|
|
|
SET(REVISIONFILE ${CMAKE_CURRENT_BINARY_DIR}/src/revision.h)
|
|
|
|
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
OUTPUT ${REVISIONFILE}
|
2016-03-03 15:12:09 +00:00
|
|
|
COMMAND bash -f -v -x ${CMAKE_CURRENT_SOURCE_DIR}/src/create_revision.sh ${REVISIONFILE} ${USE_DBMS_TCP_PROTOCOL_VERSION_AS_CLICKHOUSE_REVISION}
|
2016-02-07 21:58:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set_source_files_properties(
|
2016-02-09 17:06:50 +00:00
|
|
|
src/ClickHouseRevision.cpp PROPERTIES OBJECT_DEPENDS ${REVISIONFILE}
|
2016-02-07 21:58:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
include_directories (${CMAKE_CURRENT_BINARY_DIR}/src/)
|
|
|
|
|
2016-10-26 22:27:38 +00:00
|
|
|
if (APPLE)
|
2016-11-02 09:29:39 +00:00
|
|
|
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND NOT "${CMAKE_SYSTEM_VERSION}" VERSION_LESS "16.1.0")
|
|
|
|
set (APPLE_SIERRA_OR_NEWER 1)
|
|
|
|
else ()
|
|
|
|
set (APPLE_SIERRA_OR_NEWER 0)
|
|
|
|
endif ()
|
|
|
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/common/apple_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/common/apple_version.h)
|
2016-10-26 22:27:38 +00:00
|
|
|
add_library (apple_rt
|
|
|
|
src/apple_rt.cpp
|
|
|
|
include/common/apple_rt.h
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2016-02-07 21:58:58 +00:00
|
|
|
add_library (common
|
|
|
|
src/DateLUT.cpp
|
|
|
|
src/DateLUTImpl.cpp
|
2016-02-09 17:06:50 +00:00
|
|
|
src/ClickHouseRevision.cpp
|
2016-02-07 21:58:58 +00:00
|
|
|
src/JSON.cpp
|
|
|
|
|
|
|
|
include/common/ApplicationServerExt.h
|
|
|
|
include/common/Common.h
|
|
|
|
include/common/DateLUT.h
|
|
|
|
include/common/DateLUTImpl.h
|
|
|
|
include/common/LocalDate.h
|
|
|
|
include/common/LocalDateTime.h
|
|
|
|
include/common/ErrorHandlers.h
|
|
|
|
include/common/likely.h
|
|
|
|
include/common/logger_useful.h
|
|
|
|
include/common/MultiVersion.h
|
2016-02-09 17:06:50 +00:00
|
|
|
include/common/ClickHouseRevision.h
|
2016-02-07 21:58:58 +00:00
|
|
|
include/common/singleton.h
|
|
|
|
include/common/strong_typedef.h
|
|
|
|
include/common/JSON.h
|
|
|
|
|
|
|
|
include/ext/bit_cast.hpp
|
|
|
|
include/ext/collection_cast.hpp
|
|
|
|
include/ext/enumerate.hpp
|
|
|
|
include/ext/function_traits.hpp
|
|
|
|
include/ext/identity.hpp
|
|
|
|
include/ext/map.hpp
|
|
|
|
include/ext/range.hpp
|
|
|
|
include/ext/scope_guard.hpp
|
|
|
|
include/ext/size.hpp
|
|
|
|
include/ext/unlock_guard.hpp
|
|
|
|
|
|
|
|
${REVISIONFILE}
|
|
|
|
)
|
|
|
|
|
2016-12-01 22:44:59 +00:00
|
|
|
# When testing for memory leaks, disable libtcmalloc.
|
|
|
|
if (ENABLE_LIBTCMALLOC)
|
|
|
|
if (DEBUG_LIBTCMALLOC)
|
|
|
|
message (STATUS "Link libtcmalloc_minimal_debug for testing")
|
|
|
|
set (MALLOC_LIBRARIES libtcmalloc_minimal_debug.a)
|
|
|
|
else ()
|
|
|
|
message (STATUS "Link libtcmalloc_minimal")
|
|
|
|
set (MALLOC_LIBRARIES tcmalloc_minimal_internal)
|
|
|
|
endif ()
|
|
|
|
else ()
|
|
|
|
message (STATUS "Disabling libtcmalloc for valgrind better analysis")
|
|
|
|
endif ()
|
2016-02-07 21:58:58 +00:00
|
|
|
|
2016-12-06 16:51:34 +00:00
|
|
|
include (${ClickHouse_SOURCE_DIR}/cmake/find_glib.cmake)
|
2016-11-09 18:48:54 +00:00
|
|
|
|
2016-05-28 00:16:28 +00:00
|
|
|
target_link_libraries (
|
|
|
|
common
|
|
|
|
pocoext
|
|
|
|
${MALLOC_LIBRARIES}
|
|
|
|
pthread
|
2016-11-16 02:10:06 +00:00
|
|
|
${GLIB_LIBS}
|
2016-11-02 09:29:39 +00:00
|
|
|
${ICU_LIBS}
|
2016-10-26 22:27:38 +00:00
|
|
|
${RT_LIBRARIES})
|
2016-05-28 00:16:28 +00:00
|
|
|
|
2016-12-01 22:44:59 +00:00
|
|
|
if (ENABLE_TESTS)
|
2016-02-07 21:58:58 +00:00
|
|
|
add_subdirectory (src/tests)
|
2016-12-01 22:44:59 +00:00
|
|
|
endif (ENABLE_TESTS)
|