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/)
|
|
|
|
|
|
|
|
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}
|
|
|
|
)
|
|
|
|
|
|
|
|
# TESTIRT-3687 DISABLE_LIBTCMALLOC - when testing for memory leaks, disable libtcmalloc
|
|
|
|
IF($ENV{DISABLE_LIBTCMALLOC})
|
|
|
|
message(STATUS "Disabling libtcmalloc for valgrind better analysis")
|
|
|
|
ELSE($ENV{DISABLE_LIBTCMALLOC})
|
|
|
|
IF($ENV{DEBUG_LIBTCMALLOC})
|
|
|
|
message(STATUS "Link libtcmalloc_minimal_debug for testing")
|
2016-05-28 00:16:28 +00:00
|
|
|
SET(MALLOC_LIBRARIES libtcmalloc_minimal_debug.a)
|
2016-02-07 21:58:58 +00:00
|
|
|
ELSE($ENV{DEBUG_LIBTCMALLOC})
|
|
|
|
message(STATUS "Link libtcmalloc_minimal")
|
2016-05-28 00:32:37 +00:00
|
|
|
SET(MALLOC_LIBRARIES tcmalloc_minimal_internal)
|
2016-02-07 21:58:58 +00:00
|
|
|
ENDIF($ENV{DEBUG_LIBTCMALLOC})
|
|
|
|
ENDIF($ENV{DISABLE_LIBTCMALLOC})
|
|
|
|
|
2016-05-28 00:16:28 +00:00
|
|
|
target_link_libraries (
|
|
|
|
common
|
|
|
|
pocoext
|
|
|
|
${MALLOC_LIBRARIES}
|
|
|
|
pthread
|
|
|
|
libglib-2.0.a
|
|
|
|
libicui18n.a libicuuc.a libicudata.a
|
|
|
|
librt.a)
|
|
|
|
|
2016-02-07 21:58:58 +00:00
|
|
|
IF(TESTS)
|
|
|
|
add_subdirectory (src/tests)
|
|
|
|
ENDIF(TESTS)
|