ClickHouse/libs/libcommon/CMakeLists.txt
proller 72ccc69212 Debian: simpler package (#662)
* Allow use external re2 with re2_st=re2

* fix

* remove dupe

* use re2_st in FunctionsStringSearch.h

* fix

* move files from tools/etc to debian

* dont generate control

* version

* ok.

* wip

* Cmake: dont touch CMAKE_INSTALL_PREFIX

* wip

* works!

* clean

* okay

* like old

* wip

* wip

* okay

* clickhouse-server-base-dbg

* clean

* clickhouse-server-dbg

* Debian: Remove daemons

* Update rules

* add source/format

* control clean

* add watch

* clean

* clean

* temp fix build

* clean

* docs

* fake make_control

* fix

* testme

* testme

* add metrika package

* fake metrika files
2017-04-10 20:43:30 +03:00

91 lines
2.5 KiB
CMake

include_directories (include)
include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libcctz/include)
include(${ClickHouse_SOURCE_DIR}/cmake/dbms_include.cmake)
if (APPLE)
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 ()
endif ()
set (CONFIG_COMMON ${CMAKE_CURRENT_BINARY_DIR}/include/common/config_common.h)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/common/config_common.h.in ${CONFIG_COMMON})
if (APPLE)
add_library (apple_rt
src/apple_rt.cpp
include/common/apple_rt.h
)
endif ()
add_library (common
src/DateLUT.cpp
src/DateLUTImpl.cpp
src/exp10.cpp
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/exp10.h
include/common/likely.h
include/common/logger_useful.h
include/common/MultiVersion.h
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
${CONFIG_COMMON}
)
# When testing for memory leaks, dont link tcmalloc or jemalloc.
if (USE_JEMALLOC)
message (STATUS "Link jemalloc : ${JEMALLOC_LIBRARIES}")
set (MALLOC_LIBRARIES ${JEMALLOC_LIBRARIES})
elseif (USE_TCMALLOC)
if (DEBUG_LIBTCMALLOC)
message (STATUS "Link libtcmalloc_minimal_debug for testing: ${GPERFTOOLS_TCMALLOC_MINIMAL_DEBUG}")
set (MALLOC_LIBRARIES ${GPERFTOOLS_TCMALLOC_MINIMAL_DEBUG})
else ()
message (STATUS "Link libtcmalloc_minimal : ${GPERFTOOLS_TCMALLOC_MINIMAL}")
set (MALLOC_LIBRARIES ${GPERFTOOLS_TCMALLOC_MINIMAL})
endif ()
else ()
message (STATUS "Disabling libtcmalloc for valgrind better analysis")
endif ()
find_package (Threads)
target_link_libraries (
common
pocoext
cctz
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${MALLOC_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${RT_LIBRARIES})
if (ENABLE_TESTS)
add_subdirectory (src/tests)
endif ()