From d6833a0d5569a9dbd4d1cdf67d95015712f13cb6 Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 3 Aug 2017 15:44:39 +0300 Subject: [PATCH] Cmake: remove global include_directories (#1055) * Fix .h compile * Cmake: remove global include_directories * boost include hide * fix cctz * add \n --- cmake/find_boost.cmake | 4 -- contrib/libboost/CMakeLists.txt | 5 ++ contrib/libbtrie/CMakeLists.txt | 4 +- contrib/libcctz/CMakeLists.txt | 13 ++-- contrib/libcityhash/CMakeLists.txt | 5 +- contrib/libfarmhash/CMakeLists.txt | 4 +- contrib/liblz4/CMakeLists.txt | 3 +- contrib/libmetrohash/CMakeLists.txt | 4 +- contrib/libre2/CMakeLists.txt | 6 +- contrib/libtcmalloc/CMakeLists.txt | 73 ++++++++++---------- contrib/libunwind/CMakeLists.txt | 10 ++- contrib/libzookeeper/CMakeLists.txt | 17 ++--- dbms/cmake/find_vectorclass.cmake | 13 ++-- dbms/src/Functions/CMakeLists.txt | 4 ++ dbms/tests/CMakeLists.txt | 2 +- libs/libcommon/CMakeLists.txt | 4 +- libs/libcommon/cmake/find_cctz.cmake | 2 - libs/libcommon/cmake/find_gperftools.cmake | 4 -- libs/libcommon/cmake/find_jemalloc.cmake | 3 +- libs/libdaemon/CMakeLists.txt | 8 +-- libs/libdaemon/cmake/find_unwind.cmake | 2 - libs/libmysqlxx/CMakeLists.txt | 4 +- libs/libmysqlxx/cmake/find_mysqlclient.cmake | 1 - libs/libmysqlxx/src/tests/CMakeLists.txt | 1 - libs/libpocoext/CMakeLists.txt | 6 +- utils/corrector_utf8/CMakeLists.txt | 1 - utils/iotest/CMakeLists.txt | 2 - 27 files changed, 100 insertions(+), 105 deletions(-) diff --git a/cmake/find_boost.cmake b/cmake/find_boost.cmake index 12dc9ec809c..a7f72d8c68e 100644 --- a/cmake/find_boost.cmake +++ b/cmake/find_boost.cmake @@ -16,9 +16,6 @@ if (NOT USE_INTERNAL_BOOST_LIBRARY) set (Boost_SYSTEM_LIBRARY "") endif () - if (Boost_INCLUDE_DIRS) - include_directories (${Boost_INCLUDE_DIRS}) - endif () endif () if (NOT Boost_SYSTEM_LIBRARY) @@ -28,7 +25,6 @@ if (NOT Boost_SYSTEM_LIBRARY) set (Boost_SYSTEM_LIBRARY boost_system_internal) set (Boost_FILESYSTEM_LIBRARY boost_filesystem_internal) set (Boost_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/libboost/boost_1_62_0/") - include_directories (BEFORE ${Boost_INCLUDE_DIRS}) endif () message (STATUS "Using Boost: ${Boost_INCLUDE_DIRS} : ${Boost_PROGRAM_OPTIONS_LIBRARY},${Boost_SYSTEM_LIBRARY},${Boost_FILESYSTEM_LIBRARY}") diff --git a/contrib/libboost/CMakeLists.txt b/contrib/libboost/CMakeLists.txt index 45f01045b31..8c630ee1dba 100644 --- a/contrib/libboost/CMakeLists.txt +++ b/contrib/libboost/CMakeLists.txt @@ -48,3 +48,8 @@ boost_1_62_0/libs/test/src/unit_test_monitor.cpp boost_1_62_0/libs/test/src/unit_test_parameters.cpp boost_1_62_0/libs/test/src/xml_log_formatter.cpp boost_1_62_0/libs/test/src/xml_report_formatter.cpp) + +target_include_directories (boost_program_options_internal BEFORE PUBLIC ${Boost_INCLUDE_DIRS}) +target_include_directories (boost_filesystem_internal BEFORE PUBLIC ${Boost_INCLUDE_DIRS}) +target_include_directories (boost_system_internal BEFORE PUBLIC ${Boost_INCLUDE_DIRS}) +target_include_directories (boost_test_internal BEFORE PUBLIC ${Boost_INCLUDE_DIRS}) diff --git a/contrib/libbtrie/CMakeLists.txt b/contrib/libbtrie/CMakeLists.txt index 8d91eb1c316..7423fc57bea 100644 --- a/contrib/libbtrie/CMakeLists.txt +++ b/contrib/libbtrie/CMakeLists.txt @@ -1,6 +1,6 @@ -include_directories (BEFORE include) - add_library (btrie src/btrie.c include/btrie.h ) + +target_include_directories (btrie PUBLIC include) diff --git a/contrib/libcctz/CMakeLists.txt b/contrib/libcctz/CMakeLists.txt index 14767e6c7f7..e87a7da4c44 100644 --- a/contrib/libcctz/CMakeLists.txt +++ b/contrib/libcctz/CMakeLists.txt @@ -1,9 +1,3 @@ -include_directories (include) - -if (CMAKE_SYSTEM MATCHES "FreeBSD") - # yes, need linux, because bsd check inside linux in time_zone_libc.cc:24 - add_definitions (-D__USE_BSD -Dlinux -D_XOPEN_SOURCE=600) -endif () add_library(cctz src/time_zone_libc.cc @@ -24,3 +18,10 @@ add_library(cctz include/time_zone.h include/civil_time_detail.h include/civil_time.h) + +if (CMAKE_SYSTEM MATCHES "FreeBSD") + # yes, need linux, because bsd check inside linux in time_zone_libc.cc:24 + target_compile_definitions (cctz PRIVATE __USE_BSD linux _XOPEN_SOURCE=600) +endif () + +target_include_directories (cctz PUBLIC include) diff --git a/contrib/libcityhash/CMakeLists.txt b/contrib/libcityhash/CMakeLists.txt index 3bc7fe8a041..8c3716d8526 100644 --- a/contrib/libcityhash/CMakeLists.txt +++ b/contrib/libcityhash/CMakeLists.txt @@ -1,8 +1,9 @@ -include_directories (include src) - add_library(cityhash src/city.cc include/citycrc.h include/city.h src/config.h) + +target_include_directories (cityhash PUBLIC include) +target_include_directories (cityhash PRIVATE src) diff --git a/contrib/libfarmhash/CMakeLists.txt b/contrib/libfarmhash/CMakeLists.txt index 170fb17ac53..7781028094d 100644 --- a/contrib/libfarmhash/CMakeLists.txt +++ b/contrib/libfarmhash/CMakeLists.txt @@ -1,5 +1,5 @@ -include_directories (${CMAKE_CURRENT_BINARY_DIR}) - add_library(farmhash farmhash.cc farmhash.h) + +target_include_directories (farmhash PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/contrib/liblz4/CMakeLists.txt b/contrib/liblz4/CMakeLists.txt index 033b923e8e3..98f13476887 100644 --- a/contrib/liblz4/CMakeLists.txt +++ b/contrib/liblz4/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories (BEFORE include) - add_library (lz4 src/lz4.c src/lz4hc.c @@ -8,3 +6,4 @@ add_library (lz4 include/lz4/lz4hc.h include/lz4/lz4opt.h) +target_include_directories(lz4 PUBLIC include) diff --git a/contrib/libmetrohash/CMakeLists.txt b/contrib/libmetrohash/CMakeLists.txt index f9a2d147e22..6947b92e054 100644 --- a/contrib/libmetrohash/CMakeLists.txt +++ b/contrib/libmetrohash/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories (${CMAKE_CURRENT_BINARY_DIR}) - if (HAVE_SSE42) # Not used. Pretty easy to port. set (SOURCES_SSE42_ONLY src/metrohash128crc.cpp) endif () @@ -11,3 +9,5 @@ add_library(metrohash src/metrohash64.cpp src/metrohash128.cpp ${SOURCES_SSE42_ONLY}) + +target_include_directories(metrohash PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/contrib/libre2/CMakeLists.txt b/contrib/libre2/CMakeLists.txt index c76162fa371..111c60f3f49 100644 --- a/contrib/libre2/CMakeLists.txt +++ b/contrib/libre2/CMakeLists.txt @@ -34,14 +34,12 @@ set (re2_sources # re2 changes its state during matching of regular expression, e.g. creates temporary DFA. # It uses RWLock to process the same regular expression object from different threads. # In order to avoid redundant locks in some cases, we use not thread-safe version of the library (re2_st). -add_definitions (-DNDEBUG) - -include_directories (BEFORE .) add_library (re2 ${re2_sources}) add_library (re2_st ${re2_sources}) -set_target_properties (re2_st PROPERTIES COMPILE_DEFINITIONS "NO_THREADS;re2=re2_st") +target_compile_definitions (re2 PRIVATE NDEBUG) +target_compile_definitions (re2_st PRIVATE NDEBUG NO_THREADS re2=re2_st) file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/re2_st) foreach (FILENAME filtered_re2.h re2.h set.h stringpiece.h variadic_function.h) diff --git a/contrib/libtcmalloc/CMakeLists.txt b/contrib/libtcmalloc/CMakeLists.txt index d07ed17a0b2..57b7cd9c553 100644 --- a/contrib/libtcmalloc/CMakeLists.txt +++ b/contrib/libtcmalloc/CMakeLists.txt @@ -1,39 +1,5 @@ -add_definitions( - -DNO_TCMALLOC_SAMPLES - -DNDEBUG - -DNO_FRAME_POINTER - -Wwrite-strings - -Wno-sign-compare - -Wno-unused-result - -Wno-deprecated-declarations - -Wno-unused-function - -Wno-unused-private-field - -fno-builtin-malloc - -fno-builtin-free - -fno-builtin-realloc - -fno-builtin-calloc - -fno-builtin-cfree - -fno-builtin-memalign - -fno-builtin-posix_memalign - -fno-builtin-valloc - -fno-builtin-pvalloc -) -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.9) - add_definitions( -Wno-dynamic-exception-spec ) -endif() - -if(CMAKE_SYSTEM MATCHES "FreeBSD" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - add_definitions(-Wno-unused-but-set-variable) -endif() - -if(CMAKE_SYSTEM MATCHES "FreeBSD") - add_definitions(-D_GNU_SOURCE) -endif() - -include_directories (include src) - -message(STATUS "Building: tcmalloc_minimal_internal") +message (STATUS "Building: tcmalloc_minimal_internal") add_library (tcmalloc_minimal_internal ./src/malloc_hook.cc @@ -71,3 +37,40 @@ add_library (tcmalloc_minimal_internal ./src/raw_printer.cc ./src/memory_region_map.cc ) + +target_compile_options (tcmalloc_minimal_internal PUBLIC + -DNO_TCMALLOC_SAMPLES + -DNDEBUG + -DNO_FRAME_POINTER + -Wwrite-strings + -Wno-sign-compare + -Wno-unused-result + -Wno-deprecated-declarations + -Wno-unused-function + -Wno-unused-private-field + -fno-builtin-malloc + -fno-builtin-free + -fno-builtin-realloc + -fno-builtin-calloc + -fno-builtin-cfree + -fno-builtin-memalign + -fno-builtin-posix_memalign + -fno-builtin-valloc + -fno-builtin-pvalloc +) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.9) + target_compile_options(tcmalloc_minimal_internal PUBLIC -Wno-dynamic-exception-spec ) +endif () + +if (CMAKE_SYSTEM MATCHES "FreeBSD" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(tcmalloc_minimal_internal PUBLIC -Wno-unused-but-set-variable) +endif () + +if (CMAKE_SYSTEM MATCHES "FreeBSD") + target_compile_definitions(tcmalloc_minimal_internal PUBLIC _GNU_SOURCE) +endif () + +target_include_directories (tcmalloc_minimal_internal PUBLIC include) +target_include_directories (tcmalloc_minimal_internal PRIVATE src) + diff --git a/contrib/libunwind/CMakeLists.txt b/contrib/libunwind/CMakeLists.txt index 69f67c52a39..1a1b1e79bc3 100644 --- a/contrib/libunwind/CMakeLists.txt +++ b/contrib/libunwind/CMakeLists.txt @@ -1,6 +1,3 @@ -add_definitions(-DHAVE_CONFIG_H=1 -D_XOPEN_SOURCE -D_GNU_SOURCE -Wno-visibility -Wno-header-guard) - -include_directories(include include/tdep src) enable_language(ASM) @@ -55,3 +52,10 @@ src/elf64.c src/os-linux.c src/x86_64/Los-linux.c ) + +target_compile_definitions (unwind PRIVATE HAVE_CONFIG_H=1 _XOPEN_SOURCE _GNU_SOURCE) +target_compile_options (unwind PRIVATE -Wno-visibility -Wno-header-guard) + +target_include_directories (unwind PUBLIC include) +target_include_directories (unwind PRIVATE include/tdep) +target_include_directories (unwind PRIVATE src) diff --git a/contrib/libzookeeper/CMakeLists.txt b/contrib/libzookeeper/CMakeLists.txt index db13694527b..1d9eb050c9c 100644 --- a/contrib/libzookeeper/CMakeLists.txt +++ b/contrib/libzookeeper/CMakeLists.txt @@ -1,8 +1,3 @@ -add_definitions(-DHAVE_CONFIG_H -DTHREADED) - -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - add_definitions(-Wno-unused-but-set-variable) -endif() add_library (zookeeper_mt src/zookeeper.c @@ -15,8 +10,14 @@ src/hashtable/hashtable.c src/hashtable/hashtable_itr.c ) +target_compile_definitions (zookeeper_mt PRIVATE HAVE_CONFIG_H THREADED) + +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options (zookeeper_mt PRIVATE -Wno-unused-but-set-variable) +endif() + target_include_directories (zookeeper_mt - PRIVATE include/zookeeper - PRIVATE src - INTERFACE include + PRIVATE include/zookeeper + PRIVATE src + INTERFACE include ) diff --git a/dbms/cmake/find_vectorclass.cmake b/dbms/cmake/find_vectorclass.cmake index c94bb4640e3..021929a4090 100644 --- a/dbms/cmake/find_vectorclass.cmake +++ b/dbms/cmake/find_vectorclass.cmake @@ -3,14 +3,13 @@ option (ENABLE_VECTORCLASS "Faster math functions with vectorclass lib" OFF) if (ENABLE_VECTORCLASS) -set (VECTORCLASS_INCLUDE_PATHS "${ClickHouse_SOURCE_DIR}/contrib/vectorclass" CACHE STRING "Path of vectorclass library") -find_path (VECTORCLASS_INCLUDE_DIR NAMES vectorf128.h PATHS ${VECTORCLASS_INCLUDE_PATHS}) + set (VECTORCLASS_INCLUDE_PATHS "${ClickHouse_SOURCE_DIR}/contrib/vectorclass" CACHE STRING "Path of vectorclass library") + find_path (VECTORCLASS_INCLUDE_DIR NAMES vectorf128.h PATHS ${VECTORCLASS_INCLUDE_PATHS}) -if (VECTORCLASS_INCLUDE_DIR) - set (USE_VECTORCLASS 1) - include_directories (BEFORE ${VECTORCLASS_INCLUDE_DIR}) -endif () + if (VECTORCLASS_INCLUDE_DIR) + set (USE_VECTORCLASS 1) + endif () -message (STATUS "Using vectorclass=${ENABLE_VECTORCLASS}: ${VECTORCLASS_INCLUDE_DIR}") + message (STATUS "Using vectorclass=${USE_VECTORCLASS}: ${VECTORCLASS_INCLUDE_DIR}") endif () diff --git a/dbms/src/Functions/CMakeLists.txt b/dbms/src/Functions/CMakeLists.txt index 36017fd0d18..d92e2a4603f 100644 --- a/dbms/src/Functions/CMakeLists.txt +++ b/dbms/src/Functions/CMakeLists.txt @@ -68,6 +68,10 @@ target_include_directories (clickhouse_functions BEFORE PUBLIC ${ClickHouse_SOUR target_include_directories (clickhouse_functions BEFORE PUBLIC ${ClickHouse_SOURCE_DIR}/contrib/libmetrohash/src) target_include_directories (clickhouse_functions BEFORE PUBLIC ${CITYHASH_INCLUDE_DIR}) +if (USE_VECTORCLASS) + target_include_directories (clickhouse_functions BEFORE PUBLIC ${VECTORCLASS_INCLUDE_DIR}) +endif () + if (ENABLE_TESTS) add_subdirectory (tests) endif () diff --git a/dbms/tests/CMakeLists.txt b/dbms/tests/CMakeLists.txt index 7ec702449f2..3eff0f02cc9 100644 --- a/dbms/tests/CMakeLists.txt +++ b/dbms/tests/CMakeLists.txt @@ -11,7 +11,7 @@ endif () # Google Test from sources add_subdirectory(${ClickHouse_SOURCE_DIR}/contrib/googletest ${CMAKE_CURRENT_BINARY_DIR}/googletest) # avoid problems with -target_compile_definitions (gtest INTERFACE -DGTEST_HAS_POSIX_RE=0) +target_compile_definitions (gtest INTERFACE GTEST_HAS_POSIX_RE=0) target_include_directories (gtest INTERFACE ${ClickHouse_SOURCE_DIR}/contrib/googletest/include) diff --git a/libs/libcommon/CMakeLists.txt b/libs/libcommon/CMakeLists.txt index 534d728e49b..0c50a44089d 100644 --- a/libs/libcommon/CMakeLists.txt +++ b/libs/libcommon/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories (include) - if (APPLE) if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND NOT "${CMAKE_SYSTEM_VERSION}" VERSION_LESS "16.1.0") set (APPLE_SIERRA_OR_NEWER 1) @@ -80,7 +78,7 @@ find_package (Threads) target_include_directories (common BEFORE PRIVATE ${CCTZ_INCLUDE_DIR}) target_include_directories (common BEFORE PUBLIC ${CITYHASH_INCLUDE_DIR}) -target_include_directories (common BEFORE PUBLIC ${COMMON_INCLUDE_DIR}) +target_include_directories (common PUBLIC ${COMMON_INCLUDE_DIR}) target_link_libraries ( common diff --git a/libs/libcommon/cmake/find_cctz.cmake b/libs/libcommon/cmake/find_cctz.cmake index 807cb9eb56c..a8a4d99521d 100644 --- a/libs/libcommon/cmake/find_cctz.cmake +++ b/libs/libcommon/cmake/find_cctz.cmake @@ -6,11 +6,9 @@ if (NOT USE_INTERNAL_CCTZ_LIBRARY) endif () if (CCTZ_LIBRARY AND CCTZ_INCLUDE_DIR) - #include_directories (${CCTZ_INCLUDE_DIR}) else () set (USE_INTERNAL_CCTZ_LIBRARY 1) set (CCTZ_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libcctz/include") - #include_directories (BEFORE ${CCTZ_INCLUDE_DIR}) set (CCTZ_LIBRARY cctz) endif () diff --git a/libs/libcommon/cmake/find_gperftools.cmake b/libs/libcommon/cmake/find_gperftools.cmake index 052755c9d51..ff95e2a480a 100644 --- a/libs/libcommon/cmake/find_gperftools.cmake +++ b/libs/libcommon/cmake/find_gperftools.cmake @@ -10,16 +10,12 @@ if (ENABLE_LIBTCMALLOC) #contrib/libtcmalloc doesnt build debug version, try find in system if (DEBUG_LIBTCMALLOC OR NOT USE_INTERNAL_GPERFTOOLS_LIBRARY) find_package (Gperftools) - if (GPERFTOOLS_FOUND) - include_directories (${GPERFTOOLS_INCLUDE_DIR}) - endif () endif () if (NOT (GPERFTOOLS_FOUND AND GPERFTOOLS_INCLUDE_DIR AND GPERFTOOLS_TCMALLOC_MINIMAL)) set (USE_INTERNAL_GPERFTOOLS_LIBRARY 1) set (GPERFTOOLS_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libtcmalloc/include") set (GPERFTOOLS_TCMALLOC_MINIMAL tcmalloc_minimal_internal) - include_directories (BEFORE ${GPERFTOOLS_INCLUDE_DIR}) endif () set (USE_TCMALLOC 1) diff --git a/libs/libcommon/cmake/find_jemalloc.cmake b/libs/libcommon/cmake/find_jemalloc.cmake index bac53073be9..f8fb20fe9b6 100644 --- a/libs/libcommon/cmake/find_jemalloc.cmake +++ b/libs/libcommon/cmake/find_jemalloc.cmake @@ -1,10 +1,9 @@ option (ENABLE_JEMALLOC "Set to TRUE to use jemalloc instead of tcmalloc" OFF) if (ENABLE_JEMALLOC) - find_package(JeMalloc) + find_package (JeMalloc) if (JEMALLOC_INCLUDE_DIR AND JEMALLOC_LIBRARIES) - include_directories (${JEMALLOC_INCLUDE_DIR}) set (USE_JEMALLOC 1) if (USE_TCMALLOC) message (WARNING "Disabling tcmalloc") diff --git a/libs/libdaemon/CMakeLists.txt b/libs/libdaemon/CMakeLists.txt index e20a99a78cc..6a2fde64588 100644 --- a/libs/libdaemon/CMakeLists.txt +++ b/libs/libdaemon/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories (include) - add_library (daemon src/BaseDaemon.cpp src/GraphiteWriter.cpp @@ -11,10 +9,12 @@ add_library (daemon ) if (USE_UNWIND) + target_compile_definitions (daemon PRIVATE USE_UNWIND=1) target_include_directories (daemon BEFORE PRIVATE ${UNWIND_INCLUDE_DIR}) - add_definitions(-DUSE_UNWIND=1) target_link_libraries (daemon ${UNWIND_LIBRARY}) endif () -target_link_libraries (daemon dbms) +target_include_directories (daemon PUBLIC include) target_include_directories (daemon PRIVATE ${ClickHouse_SOURCE_DIR}/libs/libpocoext/include) + +target_link_libraries (daemon dbms) diff --git a/libs/libdaemon/cmake/find_unwind.cmake b/libs/libdaemon/cmake/find_unwind.cmake index 007240ad88b..0c55715b60c 100644 --- a/libs/libdaemon/cmake/find_unwind.cmake +++ b/libs/libdaemon/cmake/find_unwind.cmake @@ -33,12 +33,10 @@ if (NOT USE_INTERNAL_UNWIND_LIBRARY) endif () if (UNWIND_LIBRARY AND UNWIND_INCLUDE_DIR) - #include_directories (${UNWIND_INCLUDE_DIR}) set (USE_UNWIND 1) elseif (CMAKE_SYSTEM MATCHES "Linux" AND NOT ARM) set (USE_INTERNAL_UNWIND_LIBRARY 1) set (UNWIND_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/libunwind/include") - #include_directories (BEFORE ${UNWIND_INCLUDE_DIR}) set (UNWIND_LIBRARY unwind) set (USE_UNWIND 1) endif () diff --git a/libs/libmysqlxx/CMakeLists.txt b/libs/libmysqlxx/CMakeLists.txt index f3455f780e1..df732d24d02 100644 --- a/libs/libmysqlxx/CMakeLists.txt +++ b/libs/libmysqlxx/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories (include) -include_directories (${ClickHouse_SOURCE_DIR}/libs/libcommon/include) add_library (mysqlxx src/Connection.cpp @@ -30,6 +28,8 @@ add_library (mysqlxx include/mysqlxx/Value.h ) +target_include_directories (mysqlxx PUBLIC include) + set(PLATFORM_LIBS ${CMAKE_DL_LIBS}) if (USE_STATIC_LIBRARIES AND STATIC_MYSQLCLIENT_LIB) diff --git a/libs/libmysqlxx/cmake/find_mysqlclient.cmake b/libs/libmysqlxx/cmake/find_mysqlclient.cmake index b98852919f6..ae77349e444 100644 --- a/libs/libmysqlxx/cmake/find_mysqlclient.cmake +++ b/libs/libmysqlxx/cmake/find_mysqlclient.cmake @@ -29,7 +29,6 @@ if (ENABLE_MYSQL) if (MYSQL_INCLUDE_DIR AND (STATIC_MYSQLCLIENT_LIB OR MYSQLCLIENT_LIB)) set (MYSQL_FOUND 1) - include_directories (${MYSQL_INCLUDE_DIR}) endif () if (MYSQL_FOUND) diff --git a/libs/libmysqlxx/src/tests/CMakeLists.txt b/libs/libmysqlxx/src/tests/CMakeLists.txt index fa419a666da..86fadceb885 100644 --- a/libs/libmysqlxx/src/tests/CMakeLists.txt +++ b/libs/libmysqlxx/src/tests/CMakeLists.txt @@ -1,4 +1,3 @@ -include_directories (${CMAKE_CURRENT_BINARY_DIR}) add_executable (mysqlxx_test mysqlxx_test.cpp) add_executable (failover failover.cpp) diff --git a/libs/libpocoext/CMakeLists.txt b/libs/libpocoext/CMakeLists.txt index 5800bfcc5b6..18eaaabf67d 100644 --- a/libs/libpocoext/CMakeLists.txt +++ b/libs/libpocoext/CMakeLists.txt @@ -1,6 +1,3 @@ -include_directories (include) -include_directories (${ClickHouse_SOURCE_DIR}/libs/libcommon/include) - add_library (pocoext src/LevelFilterChannel.cpp src/ThreadNumber.cpp @@ -8,4 +5,7 @@ add_library (pocoext include/Poco/Ext/LevelFilterChannel.h include/Poco/Ext/ThreadNumber.h) +target_include_directories (pocoext PUBLIC include PRIVATE ${COMMON_INCLUDE_DIR}) + + target_link_libraries(pocoext ${Poco_Util_LIBRARY} ${Poco_Net_LIBRARY} ${Poco_XML_LIBRARY} ${Poco_Foundation_LIBRARY}) diff --git a/utils/corrector_utf8/CMakeLists.txt b/utils/corrector_utf8/CMakeLists.txt index a48433c5804..db5cfc4964b 100644 --- a/utils/corrector_utf8/CMakeLists.txt +++ b/utils/corrector_utf8/CMakeLists.txt @@ -1,4 +1,3 @@ -include_directories (${ClickHouse_SOURCE_DIR}/dbms/src) add_executable(corrector_utf8 corrector_utf8.cpp) diff --git a/utils/iotest/CMakeLists.txt b/utils/iotest/CMakeLists.txt index 9c1bb50cb2c..f4f916b3f7f 100644 --- a/utils/iotest/CMakeLists.txt +++ b/utils/iotest/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories (${ClickHouse_SOURCE_DIR}/dbms/src) -include_directories (${ClickHouse_SOURCE_DIR}/libs/libcommon/include) add_executable (iotest iotest.cpp ${SRCS}) target_link_libraries (iotest dbms)