minor bugs fixed, slightly modified main cmake

This commit is contained in:
myrrc 2020-09-15 23:17:24 +03:00
parent bd1a7c69ba
commit dc94a754dd
3 changed files with 127 additions and 105 deletions

View File

@ -29,7 +29,8 @@ endforeach()
project(ClickHouse)
option(FAIL_ON_UNSUPPORTED_OPTIONS_COMBINATION
"Stop/Fail CMake configuration if some ENABLE_XXX option is defined (either ON or OFF) but is not possible to satisfy" ON)
"Stop/Fail CMake configuration if some ENABLE_XXX option is defined (either ON or OFF)
but is not possible to satisfy" ON)
if(FAIL_ON_UNSUPPORTED_OPTIONS_COMBINATION)
set(RECONFIGURE_MESSAGE_LEVEL FATAL_ERROR)
@ -60,7 +61,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Need cmake 3.9+
# Usually impractical.
# See also ENABLE_THINLTO
option(ENABLE_IPO "Enable full link time optimization")
option(ENABLE_IPO "Full link time optimization")
if(ENABLE_IPO)
cmake_policy(SET CMP0069 NEW)
@ -91,12 +92,16 @@ message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
string (TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
option (USE_STATIC_LIBRARIES "Set to FALSE to use shared libraries" ON)
option (MAKE_STATIC_LIBRARIES "Set to FALSE to make shared libraries" ${USE_STATIC_LIBRARIES})
option(USE_STATIC_LIBRARIES "Disable to use shared libraries" ON)
option(MAKE_STATIC_LIBRARIES "Disable to make shared libraries" ${USE_STATIC_LIBRARIES})
if (NOT MAKE_STATIC_LIBRARIES)
option (SPLIT_SHARED_LIBRARIES "DEV ONLY. Keep all internal libs as separate .so for faster linking" OFF)
option (CLICKHOUSE_SPLIT_BINARY "Make several binaries instead one bundled (clickhouse-server, clickhouse-client, ... )" OFF)
# DEVELOPER ONLY.
# Faster linking if turned on.
option(SPLIT_SHARED_LIBRARIES "Keep all internal libraries as separate .so files")
option(CLICKHOUSE_SPLIT_BINARY
"Make several binaries (clickhouse-server, clickhouse-client etc.) instead of one bundled")
endif ()
if (MAKE_STATIC_LIBRARIES AND SPLIT_SHARED_LIBRARIES)
@ -111,7 +116,9 @@ if (USE_STATIC_LIBRARIES)
list(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
endif ()
option (ENABLE_FUZZING "Enables fuzzing instrumentation" OFF)
# Enable fuzzy testing using libfuzzer
# Implies ${WITH_COVERAGE}
option (ENABLE_FUZZING "Enables fuzzing instrumentation")
if (ENABLE_FUZZING)
message (STATUS "Fuzzing instrumentation enabled")
@ -143,10 +150,13 @@ if (COMPILER_CLANG)
endif ()
endif ()
option (ENABLE_TESTS "Enables tests" ON)
# Adds a Google.Test target binary containing unit tests.
option (ENABLE_TESTS ON)
if (OS_LINUX AND NOT UNBUNDLED AND MAKE_STATIC_LIBRARIES AND NOT SPLIT_SHARED_LIBRARIES AND CMAKE_VERSION VERSION_GREATER "3.9.0")
option (GLIBC_COMPATIBILITY "Set to TRUE to enable compatibility with older glibc libraries. Only for x86_64, Linux. Implies ENABLE_FASTMEMCPY." ON)
# Only for Linux, x86_64.
# Implies ${ENABLE_FASTMEMCPY}
option(GLIBC_COMPATIBILITY "Enable compatibility with older glibc libraries." ON)
elseif(GLIBC_COMPATIBILITY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Glibc compatibility cannot be enabled in current configuration")
endif ()
@ -179,7 +189,8 @@ else ()
set(NO_WHOLE_ARCHIVE --no-whole-archive)
endif ()
option (ADD_GDB_INDEX_FOR_GOLD "Set to add .gdb-index to resulting binaries for gold linker. NOOP if lld is used." 0)
option(ADD_GDB_INDEX_FOR_GOLD "Add .gdb-index to resulting binaries for gold linker. NOOP if lld is used.")
if (NOT CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE")
if (LINKER_NAME STREQUAL "lld")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index")
@ -200,6 +211,7 @@ if (NOT CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE")
endif()
cmake_host_system_information(RESULT AVAILABLE_PHYSICAL_MEMORY QUERY AVAILABLE_PHYSICAL_MEMORY) # Not available under freebsd
if(NOT AVAILABLE_PHYSICAL_MEMORY OR AVAILABLE_PHYSICAL_MEMORY GREATER 8000)
option(COMPILER_PIPE "-pipe compiler option [less /tmp usage, more ram usage]" ON)
endif()
@ -213,7 +225,8 @@ if(NOT DISABLE_CPU_OPTIMIZE)
include(cmake/cpu_features.cmake)
endif()
option(ARCH_NATIVE "Enable -march=native compiler flag" 0)
option(ARCH_NATIVE "Add -march=native compiler flag")
if (ARCH_NATIVE)
set (COMPILER_FLAGS "${COMPILER_FLAGS} -march=native")
endif ()
@ -224,6 +237,7 @@ if (UNBUNDLED AND (COMPILER_GCC OR COMPILER_CLANG))
else()
set (_CXX_STANDARD "-std=c++2a")
endif()
# cmake < 3.12 doesn't support 20. We'll set CMAKE_CXX_FLAGS for now
# set (CMAKE_CXX_STANDARD 20)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_CXX_STANDARD}")
@ -236,7 +250,8 @@ if (COMPILER_GCC OR COMPILER_CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsized-deallocation")
endif ()
option(WITH_COVERAGE "Build with coverage." 0)
# Compiler-specific coverage flags e.g. -fcoverage-mapping for gcc
option(WITH_COVERAGE)
if (WITH_COVERAGE AND COMPILER_CLANG)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fprofile-instr-generate -fcoverage-mapping")
@ -270,10 +285,13 @@ if (COMPILER_CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-absolute-paths")
if (NOT ENABLE_TESTS AND NOT SANITIZE)
option(ENABLE_THINLTO "Enable Thin LTO. Only applicable for clang. It's also suppressed when building with tests or sanitizers." ON)
# https://clang.llvm.org/docs/ThinLTO.html
# Applies to clang only.
# Disabled when building with tests or sanitizers.
option(ENABLE_THINLTO ON)
endif()
# We cannot afford to use LTO when compiling unitests, and it's not enough
# We cannot afford to use LTO when compiling unit tests, and it's not enough
# to only supply -fno-lto at the final linking stage. So we disable it
# completely.
if (ENABLE_THINLTO AND NOT ENABLE_TESTS AND NOT SANITIZE)
@ -286,8 +304,8 @@ if (COMPILER_CLANG)
endif ()
# Always prefer llvm tools when using clang. For instance, we cannot use GNU ar when llvm LTO is enabled
find_program (LLVM_AR_PATH NAMES "llvm-ar" "llvm-ar-10" "llvm-ar-9" "llvm-ar-8")
if (LLVM_AR_PATH)
message(STATUS "Using llvm-ar: ${LLVM_AR_PATH}.")
set (CMAKE_AR ${LLVM_AR_PATH})
@ -308,16 +326,21 @@ endif ()
option(ENABLE_LIBRARIES "Enable all libraries (Global default switch)" ON)
option (UNBUNDLED "Try find all libraries in system. We recommend to avoid this mode for production builds, because we cannot guarantee exact versions and variants of libraries your system has installed. This mode exists for enthusiastic developers who search for trouble. Also it is useful for maintainers of OS packages." OFF)
# We recommend avoiding this mode for production builds because we can't guarantee all needed libraries exist in your
# system.
# This mode exists for enthusiastic developers who are searching for trouble.
# Useful for maintainers of OS packages.
option (UNBUNDLED "Use system libraries instead of ones in contrib/")
if (UNBUNDLED)
set(NOT_UNBUNDLED 0)
set(NOT_UNBUNDLED OFF)
else ()
set(NOT_UNBUNDLED 1)
set(NOT_UNBUNDLED ON)
endif ()
if (UNBUNDLED OR NOT (OS_LINUX OR OS_DARWIN))
# Using system libs can cause a lot of warnings in includes (on macro expansion).
option (WERROR "Enable -Werror compiler option" OFF)
option(WERROR "Enable -Werror compiler option")
else ()
option(WERROR "Enable -Werror compiler option" ON)
endif ()
@ -361,8 +384,9 @@ else ()
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
endif ()
# Using "include-what-you-use" tool.
option (USE_INCLUDE_WHAT_YOU_USE "Use 'include-what-you-use' tool" OFF)
# https://github.com/include-what-you-use/include-what-you-use
option (USE_INCLUDE_WHAT_YOU_USE)
if (USE_INCLUDE_WHAT_YOU_USE)
find_program(IWYU_PATH NAMES include-what-you-use iwyu)
if (NOT IWYU_PATH)
@ -376,6 +400,7 @@ endif ()
if (ENABLE_TESTS)
message (STATUS "Tests are enabled")
endif ()
enable_testing() # Enable for tests without binary
# when installing to /usr - place configs to /etc but for /usr/local place to /usr/local/etc
@ -385,7 +410,13 @@ else ()
set (CLICKHOUSE_ETC_DIR "${CMAKE_INSTALL_PREFIX}/etc")
endif ()
message (STATUS "Building for: ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_LIBRARY_ARCHITECTURE} ; USE_STATIC_LIBRARIES=${USE_STATIC_LIBRARIES} MAKE_STATIC_LIBRARIES=${MAKE_STATIC_LIBRARIES} SPLIT_SHARED=${SPLIT_SHARED_LIBRARIES} UNBUNDLED=${UNBUNDLED} CCACHE=${CCACHE_FOUND} ${CCACHE_VERSION}")
message (STATUS
"Building for: ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_LIBRARY_ARCHITECTURE} ;
USE_STATIC_LIBRARIES=${USE_STATIC_LIBRARIES}
MAKE_STATIC_LIBRARIES=${MAKE_STATIC_LIBRARIES}
SPLIT_SHARED=${SPLIT_SHARED_LIBRARIES}
UNBUNDLED=${UNBUNDLED}
CCACHE=${CCACHE_FOUND} ${CCACHE_VERSION}")
include (GNUInstallDirs)
include (cmake/contrib_finder.cmake)

View File

@ -12,75 +12,68 @@ TODO describe separate cmake files for contrib + arch-dependent ones + options f
| Name | Default value | Description | Comment |
|------|---------------|-------------|---------|
| <a name="add_gdb_index_for_gold"></a>(`ADD_GDB_INDEX_FOR_GOLD`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L181] | `0` | Set to add .gdb-index to resulting binaries for gold linker. NOOP if lld is used. | |
| <a name="arch_native"></a>(`ARCH_NATIVE`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L215] | `0` | Enable -march=native compiler flag | |
| <a name="clickhouse_split_binary"></a>(`CLICKHOUSE_SPLIT_BINARY`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L98] | `OFF` | Make several binaries instead one bundled (clickhouse-server, clickhouse-client, ... ) | |
| <a name="compiler_pipe"></a>(`COMPILER_PIPE`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L203] | `ON` | -pipe compiler option [less /tmp usage, more ram usage] | |
| <a name="enable_fuzzing"></a>(`ENABLE_FUZZING`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L113] | `OFF` | Enables fuzzing instrumentation | |
| <a name="enable_ipo"></a>(`ENABLE_IPO`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L62] | `OFF` | Enable full link time optimization | |
| <a name="enable_libraries"></a>(`ENABLE_LIBRARIES`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L308] | `ON` | Enable all libraries (Global default switch) | |
| <a name="enable_tests"></a>(`ENABLE_TESTS`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L145] | `ON` | Enables tests | |
| <a name="enable_thinlto"></a>(`ENABLE_THINLTO`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L61] | `ON` | Enable Thin LTO. Only applicable for clang. It's also suppressed when building with tests or sanitizers. | Need cmake 3.9+
Usually impractical.
See also ENABLE_THINLTO
|
| <a name="fail_on_unsupported_options_combination"></a>(`FAIL_ON_UNSUPPORTED_OPTIONS_COMBINATION`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L30] | `ON` | Stop/Fail CMake configuration if some ENABLE_XXX option is defined (either ON or OFF) but is not possible to satisfy | |
| <a name="glibc_compatibility"></a>(`GLIBC_COMPATIBILITY`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L148] | `ON` | Set to TRUE to enable compatibility with older glibc libraries. Only for x86_64, Linux. Implies ENABLE_FASTMEMCPY. | |
| <a name="make_static_libraries"></a>(`MAKE_STATIC_LIBRARIES`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L94] | (`USE_STATIC_LIBRARIES`)[#use_static_libraries] | Set to FALSE to make shared libraries | |
| <a name="split_shared_libraries"></a>(`SPLIT_SHARED_LIBRARIES`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L97] | `OFF` | DEV ONLY. Keep all internal libs as separate .so for faster linking | |
| <a name="unbundled"></a>(`UNBUNDLED`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L147] | `OFF` | Try find all libraries in system. We recommend to avoid this mode for production builds, because we cannot guarantee exact versions and variants of libraries your system has installed. This mode exists for enthusiastic developers who search for trouble. Also it is useful for maintainers of OS packages. | |
| <a name="use_include_what_you_use"></a>(`USE_INCLUDE_WHAT_YOU_USE`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L364] | `OFF` | Use 'include-what-you-use' tool | |
| <a name="use_static_libraries"></a>(`USE_STATIC_LIBRARIES`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L93] | `ON` | Set to FALSE to use shared libraries | |
| <a name="werror"></a>(`WERROR`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L319] | `OFF` | Enable -Werror compiler option | |
| <a name="werror"></a>(`WERROR`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L319] | `ON` | Enable -Werror compiler option | |
| <a name="with_coverage"></a>(`WITH_COVERAGE`)[https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L117] | `0` | Build with coverage. | || <a name="weverything"></a>(`WEVERYTHING`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/warnings.cmake#L20] | `ON` | Enables -Weverything option with some exceptions. This is intended for exploration of new compiler warnings that may be found to be useful. Only makes sense for clang. | || <a name="parallel_compile_jobs"></a>(`PARALLEL_COMPILE_JOBS`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/limit_jobs.cmake#L8] | `""` | Define the maximum number of concurrent compilation jobs | |
| <a name="parallel_link_jobs"></a>(`PARALLEL_LINK_JOBS`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/limit_jobs.cmake#L21] | `""` | Define the maximum number of concurrent link jobs | || <a name="enable_clang_tidy"></a>(`ENABLE_CLANG_TIDY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/analysis.cmake#L2] | `OFF` | Use 'clang-tidy' static analyzer if present | || <a name="sanitize"></a>(`SANITIZE`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/sanitize.cmake#L0] | `""` | Enable sanitizer: address, memory, thread, undefined | || <a name="use_internal_lib_name_uc_library"></a>(`USE_INTERNAL_${LIB_NAME_UC}_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/contrib_finder.cmake#L6] | (`NOT_UNBUNDLED`)[#not_unbundled] | Use bundled library ${LIB_NAME} instead of system | || <a name="fuzzer"></a>(`FUZZER`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/fuzzer.cmake#L0] | `OFF` | Enable fuzzer: libfuzzer | || <a name="linker_name"></a>(`LINKER_NAME`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/tools.cmake#L42] | `OFF` | Linker name or full path | || <a name="enable_ssl"></a>(`ENABLE_SSL`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/ssl.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable ssl | |
| <a name="use_internal_ssl_library"></a>(`USE_INTERNAL_SSL_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/ssl.cmake#L3] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system *ssl library instead of bundled | || <a name="enable_gperf"></a>(`ENABLE_GPERF`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/gperf.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Use gperf function hash generator tool | || <a name="use_internal_sparsehash_library"></a>(`USE_INTERNAL_SPARSEHASH_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/sparsehash.cmake#L0] | `ON` | Set to FALSE to use system sparsehash library instead of bundled | || <a name="enable_base"></a>(`ENABLE_BASE64`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/base64.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable base64 | || <a name="use_internal_re_library"></a>(`USE_INTERNAL_RE2_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/re2.cmake#L0] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system re2 library instead of bundled [slower] | || <a name="enable_h"></a>(`ENABLE_H3`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/h3.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable H3 | |
| <a name="use_internal_h_library"></a>(`USE_INTERNAL_H3_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/h3.cmake#L2] | `ON` | Set to FALSE to use system h3 library instead of bundled | || <a name="enable_opencl"></a>(`ENABLE_OPENCL`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/opencl.cmake#L2] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable OpenCL support | || <a name="use_internal_libcxx_library"></a>(`USE_INTERNAL_LIBCXX_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/cxx.cmake#L3] | (`USE_INTERNAL_LIBCXX_LIBRARY_DEFAULT`)[#use_internal_libcxx_library_default] | Set to FALSE to use system libcxx and libcxxabi libraries instead of bundled | |
| <a name="use_libcxx"></a>(`USE_LIBCXX`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/cxx.cmake#L0] | (`NOT_UNBUNDLED`)[#not_unbundled] | Use libc++ and libc++abi instead of libstdc++ | || <a name="enable_mysql"></a>(`ENABLE_MYSQL`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/mysqlclient.cmake#L1] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable MySQL | |
| <a name="enable_mysql"></a>(`ENABLE_MYSQL`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/mysqlclient.cmake#L1] | `FALSE` | Enable MySQL | |
| <a name="use_internal_mysql_library"></a>(`USE_INTERNAL_MYSQL_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/mysqlclient.cmake#L7] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system mysqlclient library instead of bundled | || <a name="use_internal_zlib_library"></a>(`USE_INTERNAL_ZLIB_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/zlib.cmake#L0] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system zlib library instead of bundled | || <a name="use_simdjson"></a>(`USE_SIMDJSON`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/simdjson.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Use simdjson | || <a name="use_internal_snappy_library"></a>(`USE_INTERNAL_SNAPPY_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/snappy.cmake#L3] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system snappy library instead of bundled | |
| <a name="use_snappy"></a>(`USE_SNAPPY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/snappy.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable support of snappy library | || <a name="use_sentry"></a>(`USE_SENTRY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/sentry.cmake#L4] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Use Sentry | || <a name="use_internal_zstd_library"></a>(`USE_INTERNAL_ZSTD_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/zstd.cmake#L0] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system zstd library instead of bundled | || <a name="enable_ldap"></a>(`ENABLE_LDAP`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/ldap.cmake#L1] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable LDAP | |
| <a name="use_internal_ldap_library"></a>(`USE_INTERNAL_LDAP_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/ldap.cmake#L7] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system *LDAP library instead of bundled | || <a name="enable_curl"></a>(`ENABLE_CURL`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/curl.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable curl | |
| <a name="use_internal_curl"></a>(`USE_INTERNAL_CURL`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/curl.cmake#L3] | (`NOT_UNBUNDLED`)[#not_unbundled] | Use internal curl library | || <a name="enable_odbc"></a>(`ENABLE_ODBC`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/odbc.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable ODBC library | |
| <a name="use_internal_odbc_library"></a>(`USE_INTERNAL_ODBC_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/odbc.cmake#L10] | (`NOT_UNBUNDLED`)[#not_unbundled] | Use internal ODBC library | || <a name="use_internal_libxml_library"></a>(`USE_INTERNAL_LIBXML2_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/libxml2.cmake#L0] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system libxml2 library instead of bundled | || <a name="enable_stats"></a>(`ENABLE_STATS`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/stats.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enalbe StatsLib library | || <a name="enable_avro"></a>(`ENABLE_AVRO`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/avro.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable Avro | |
| <a name="use_internal_avro_library"></a>(`USE_INTERNAL_AVRO_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/avro.cmake#L3] | `ON` | Set to FALSE to use system avro library instead of bundled | || <a name="enable_gtest_library"></a>(`ENABLE_GTEST_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/gtest.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable gtest library | |
| <a name="use_internal_gtest_library"></a>(`USE_INTERNAL_GTEST_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/gtest.cmake#L3] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system Google Test instead of bundled | || <a name="enable_amqpcpp"></a>(`ENABLE_AMQPCPP`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/amqpcpp.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enalbe AMQP-CPP | || <a name="enable_icu"></a>(`ENABLE_ICU`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/icu.cmake#L1] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable ICU | |
| <a name="enable_icu"></a>(`ENABLE_ICU`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/icu.cmake#L1] | `0` | Enable ICU | |
| <a name="use_internal_icu_library"></a>(`USE_INTERNAL_ICU_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/icu.cmake#L7] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system ICU library instead of bundled | || <a name="enable_ccache"></a>(`ENABLE_CCACHE`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/ccache.cmake#L6] | (`ENABLE_CCACHE_BY_DEFAULT`)[#enable_ccache_by_default] | Speedup re-compilations using ccache | || <a name="enable_parquet"></a>(`ENABLE_PARQUET`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/parquet.cmake#L1] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable parquet | |
| <a name="use_internal_parquet_library"></a>(`USE_INTERNAL_PARQUET_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/parquet.cmake#L2] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system parquet library instead of bundled | || <a name="use_unwind"></a>(`USE_UNWIND`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/unwind.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable libunwind (better stacktraces) | || <a name="enable_brotli"></a>(`ENABLE_BROTLI`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/brotli.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable brotli | |
| <a name="use_internal_brotli_library"></a>(`USE_INTERNAL_BROTLI_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/brotli.cmake#L3] | (`USE_STATIC_LIBRARIES`)[#use_static_libraries] | Set to FALSE to use system libbrotli library instead of bundled | |
| <a name="use_internal_brotli_library"></a>(`USE_INTERNAL_BROTLI_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/brotli.cmake#L3] | `ON` | Set to FALSE to use system libbrotli library instead of bundled | || <a name="enable_msgpack"></a>(`ENABLE_MSGPACK`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/msgpack.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable msgpack library | |
| <a name="use_internal_msgpack_library"></a>(`USE_INTERNAL_MSGPACK_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/msgpack.cmake#L3] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system msgpack library instead of bundled | || <a name="enable_embedded_compiler"></a>(`ENABLE_EMBEDDED_COMPILER`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/llvm.cmake#L1] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Set to TRUE to enable support for 'compile_expressions' option for query execution | |
| <a name="llvm_has_rtti"></a>(`LLVM_HAS_RTTI`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/llvm.cmake#L39] | `ON` | Enable if LLVM was build with RTTI enabled | |
| <a name="use_internal_llvm_library"></a>(`USE_INTERNAL_LLVM_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/llvm.cmake#L7] | (`NOT_UNBUNDLED`)[#not_unbundled] | Use bundled or system LLVM library. | || <a name="enable_hdfs"></a>(`ENABLE_HDFS`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/hdfs3.cmake#L1] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable HDFS | |
| <a name="use_internal_hdfs_library"></a>(`USE_INTERNAL_HDFS3_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/hdfs3.cmake#L2] | `ON` | Set to FALSE to use system HDFS3 instead of bundled (experimental - set to OFF on your own risk) | || <a name="enable_gsasl_library"></a>(`ENABLE_GSASL_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/libgsasl.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable gsasl library | |
| <a name="use_internal_libgsasl_library"></a>(`USE_INTERNAL_LIBGSASL_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/libgsasl.cmake#L3] | (`USE_STATIC_LIBRARIES`)[#use_static_libraries] | Set to FALSE to use system libgsasl library instead of bundled | |
| <a name="use_internal_libgsasl_library"></a>(`USE_INTERNAL_LIBGSASL_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/libgsasl.cmake#L3] | `ON` | Set to FALSE to use system libgsasl library instead of bundled | || <a name="enable_fastops"></a>(`ENABLE_FASTOPS`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/fastops.cmake#L1] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable fast vectorized mathematical functions library by Mikhail Parakhin | || <a name="enable_rdkafka"></a>(`ENABLE_RDKAFKA`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/rdkafka.cmake#L2] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable kafka | |
| <a name="use_internal_rdkafka_library"></a>(`USE_INTERNAL_RDKAFKA_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/rdkafka.cmake#L10] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system librdkafka instead of the bundled | || <a name="enable_orc"></a>(`ENABLE_ORC`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/orc.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable ORC | |
| <a name="use_internal_orc_library"></a>(`USE_INTERNAL_ORC_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/orc.cmake#L3] | `ON` | Set to FALSE to use system ORC instead of bundled (experimental set to OFF on your own risk) | || <a name="enable_cassandra"></a>(`ENABLE_CASSANDRA`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/cassandra.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable Cassandra | || <a name="enable_s"></a>(`ENABLE_S3`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/s3.cmake#L1] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable S3 | |
| <a name="use_internal_aws_s_library"></a>(`USE_INTERNAL_AWS_S3_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/s3.cmake#L2] | `ON` | Set to FALSE to use system S3 instead of bundled (experimental set to OFF on your own risk) | || <a name="enable_rapidjson"></a>(`ENABLE_RAPIDJSON`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/rapidjson.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Use rapidjson | |
| <a name="use_internal_rapidjson_library"></a>(`USE_INTERNAL_RAPIDJSON_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/rapidjson.cmake#L2] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system rapidjson library instead of bundled | || <a name="use_internal_poco_library"></a>(`USE_INTERNAL_POCO_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/poco.cmake#L0] | `ON` | Use internal Poco library | || <a name="enable_grpc"></a>(`ENABLE_GRPC`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/grpc.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Use gRPC | |
| <a name="use_internal_grpc_library"></a>(`USE_INTERNAL_GRPC_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/grpc.cmake#L3] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system gRPC library instead of bundled. (Experimental. Set to OFF on your own risk) | || <a name="enable_protobuf"></a>(`ENABLE_PROTOBUF`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/protobuf.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable protobuf | |
| <a name="use_internal_protobuf_library"></a>(`USE_INTERNAL_PROTOBUF_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/protobuf.cmake#L3] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system protobuf instead of bundled | || <a name="enable_capnp"></a>(`ENABLE_CAPNP`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/capnp.cmake#L0] | (`ENABLE_LIBRARIES`)[#enable_libraries] | Enable Cap'n Proto | |
| <a name="use_internal_capnp_library"></a>(`USE_INTERNAL_CAPNP_LIBRARY`)[https://github.com/clickhouse/clickhouse/blob/master/cmake/find/capnp.cmake#L3] | (`NOT_UNBUNDLED`)[#not_unbundled] | Set to FALSE to use system capnproto library instead of bundled | || <a name="enable_multitarget_code"></a>(`ENABLE_MULTITARGET_CODE`)[https://github.com/clickhouse/clickhouse/blob/master/src/Functions/CMakeLists.txt#L117] | `ON` | | |
| <a name="strip_debug_symbols_functions"></a>(`STRIP_DEBUG_SYMBOLS_FUNCTIONS`)[https://github.com/clickhouse/clickhouse/blob/master/src/Functions/CMakeLists.txt#L64] | (`STRIP_DSF_DEFAULT`)[#strip_dsf_default] | Do not generate debugger info for ClickHouse functions.
Provides faster linking and lower binary size.
Tradeoff is the inability to debug some source files with e.g. gdb
(empty stack frames and no local variables). | || <a name="enable_clickhouse_all"></a>(`ENABLE_CLICKHOUSE_ALL`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L8] | `ON` | Enable all tools | |
| <a name="enable_clickhouse_benchmark"></a>(`ENABLE_CLICKHOUSE_BENCHMARK`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L12] | (`ENABLE_CLICKHOUSE_ALL`)[#enable_clickhouse_all] | Enable clickhouse-benchmark | |
| <a name="enable_clickhouse_client"></a>(`ENABLE_CLICKHOUSE_CLIENT`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L10] | (`ENABLE_CLICKHOUSE_ALL`)[#enable_clickhouse_all] | Enable clickhouse-client | |
| <a name="enable_clickhouse_compressor"></a>(`ENABLE_CLICKHOUSE_COMPRESSOR`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L14] | (`ENABLE_CLICKHOUSE_ALL`)[#enable_clickhouse_all] | Enable clickhouse-compressor | |
| <a name="enable_clickhouse_copier"></a>(`ENABLE_CLICKHOUSE_COPIER`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L15] | (`ENABLE_CLICKHOUSE_ALL`)[#enable_clickhouse_all] | Enable clickhouse-copier | |
| <a name="enable_clickhouse_extract_from_config"></a>(`ENABLE_CLICKHOUSE_EXTRACT_FROM_CONFIG`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L13] | (`ENABLE_CLICKHOUSE_ALL`)[#enable_clickhouse_all] | Enable clickhouse-extract-from-config | |
| <a name="enable_clickhouse_format"></a>(`ENABLE_CLICKHOUSE_FORMAT`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L16] | (`ENABLE_CLICKHOUSE_ALL`)[#enable_clickhouse_all] | Enable clickhouse-format | |
| <a name="enable_clickhouse_install"></a>(`ENABLE_CLICKHOUSE_INSTALL`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L21] | (`ENABLE_CLICKHOUSE_ALL`)[#enable_clickhouse_all] | Enable clickhouse-install | |
| <a name="enable_clickhouse_install"></a>(`ENABLE_CLICKHOUSE_INSTALL`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L21] | `OFF` | Enable clickhouse-install | |
| <a name="enable_clickhouse_local"></a>(`ENABLE_CLICKHOUSE_LOCAL`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L11] | (`ENABLE_CLICKHOUSE_ALL`)[#enable_clickhouse_all] | Enable clickhouse-local | |
| <a name="enable_clickhouse_obfuscator"></a>(`ENABLE_CLICKHOUSE_OBFUSCATOR`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L17] | (`ENABLE_CLICKHOUSE_ALL`)[#enable_clickhouse_all] | Enable clickhouse-obfuscator | |
| <a name="enable_clickhouse_odbc_bridge"></a>(`ENABLE_CLICKHOUSE_ODBC_BRIDGE`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L18] | (`ENABLE_CLICKHOUSE_ALL`)[#enable_clickhouse_all] | Enable clickhouse-odbc-bridge | |
| <a name="enable_clickhouse_server"></a>(`ENABLE_CLICKHOUSE_SERVER`)[https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L9] | (`ENABLE_CLICKHOUSE_ALL`)[#enable_clickhouse_all] | Enable clickhouse-server | |
## Developer's guide for adding new CMake options
| <a name="add-gdb-index-for-gold"></a>[`ADD_GDB_INDEX_FOR_GOLD`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L191) | `OFF` | Add .gdb-index to resulting binaries for gold linker. NOOP if lld is used. | |
| <a name="arch-native"></a>[`ARCH_NATIVE`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L227) | `OFF` | Add -march=native compiler flag | |
| <a name="clickhouse-split-binary"></a>[`CLICKHOUSE_SPLIT_BINARY`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L102) | `OFF` | Make several binaries (clickhouse-server, clickhouse-client etc.) instead of one bundled | |
| <a name="compiler-pipe"></a>[`COMPILER_PIPE`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L215) | `ON` | -pipe compiler option [less /tmp usage, more ram usage] | |
| <a name="enable-fuzzing"></a>[`ENABLE_FUZZING`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L120) | `OFF` | Enables fuzzing instrumentation | Enable fuzzy testing using libfuzzer. Implies ${WITH_COVERAGE}. |
| <a name="enable-ipo"></a>[`ENABLE_IPO`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L63) | `OFF` | Full link time optimization | Need cmake 3.9+. Usually impractical.. See also ENABLE_THINLTO. |
| <a name="enable-libraries"></a>[`ENABLE_LIBRARIES`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L326) | `ON` | Enable all libraries (Global default switch) | |
| <a name="enable-tests"></a>[`ENABLE_TESTS`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L153) | `ON` | | Adds a Google.Test target binary containing unit tests.. |
| <a name="enable-thinlto"></a>[`ENABLE_THINLTO`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L62) | `ON` | | Need cmake 3.9+. Usually impractical.. |
| <a name="fail-on-unsupported-options-combination"></a>[`FAIL_ON_UNSUPPORTED_OPTIONS_COMBINATION`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L30) | `ON` | Stop/Fail CMake configuration if some ENABLE_XXX option is defined (either ON or OFF) but is not possible to satisfy | |
| <a name="glibc-compatibility"></a>[`GLIBC_COMPATIBILITY`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L158) | `ON` | Enable compatibility with older glibc libraries. | Only for Linux, x86_64.. Implies ${ENABLE_FASTMEMCPY}. |
| <a name="make-static-libraries"></a>[`MAKE_STATIC_LIBRARIES`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L95) | [`USE_STATIC_LIBRARIES`](#use-static-libraries) | Disable to make shared libraries | |
| <a name="split-shared-libraries"></a>[`SPLIT_SHARED_LIBRARIES`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L100) | `OFF` | Keep all internal libraries as separate .so files | DEVELOPER ONLY.. Faster linking if turned on.. |
| <a name="unbundled"></a>[`UNBUNDLED`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L155) | `OFF` | Use system libraries instead of ones in contrib/ | |
| <a name="use-include-what-you-use"></a>[`USE_INCLUDE_WHAT_YOU_USE`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L387) | `OFF` | | https://github.com/include-what-you-use/include-what-you-use. |
| <a name="use-static-libraries"></a>[`USE_STATIC_LIBRARIES`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L94) | `ON` | Disable to use shared libraries | |
| <a name="werror"></a>[`WERROR`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L342) | `OFF` | Enable -Werror compiler option | Using system libs can cause a lot of warnings in includes (on macro expansion).. |
| <a name="werror"></a>[`WERROR`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L342) | `ON` | Enable -Werror compiler option | Using system libs can cause a lot of warnings in includes (on macro expansion).. |
| <a name="with-coverage"></a>[`WITH_COVERAGE`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L119) | `OFF` | | Enable fuzzy testing using libfuzzer. || <a name="weverything"></a>[`WEVERYTHING`](https://github.com/clickhouse/clickhouse/blob/master/cmake/warnings.cmake#L20) | `ON` | Enables -Weverything option with some exceptions. This is intended for exploration of new compiler warnings that may be found to be useful. Only makes sense for clang. | || <a name="parallel-compile-jobs"></a>[`PARALLEL_COMPILE_JOBS`](https://github.com/clickhouse/clickhouse/blob/master/cmake/limit_jobs.cmake#L8) | `""` | Define the maximum number of concurrent compilation jobs | |
| <a name="parallel-link-jobs"></a>[`PARALLEL_LINK_JOBS`](https://github.com/clickhouse/clickhouse/blob/master/cmake/limit_jobs.cmake#L21) | `""` | Define the maximum number of concurrent link jobs | || <a name="enable-clang-tidy"></a>[`ENABLE_CLANG_TIDY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/analysis.cmake#L2) | `OFF` | Use 'clang-tidy' static analyzer if present | || <a name="sanitize"></a>[`SANITIZE`](https://github.com/clickhouse/clickhouse/blob/master/cmake/sanitize.cmake#L0) | `""` | Enable sanitizer: address, memory, thread, undefined | || <a name="use-internal-lib-name-uc-library"></a>[`USE_INTERNAL_${LIB_NAME_UC}_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/contrib_finder.cmake#L6) | [`NOT_UNBUNDLED`](#not-unbundled) | Use bundled library ${LIB_NAME} instead of system | || <a name="fuzzer"></a>[`FUZZER`](https://github.com/clickhouse/clickhouse/blob/master/cmake/fuzzer.cmake#L0) | `OFF` | Enable fuzzer: libfuzzer | || <a name="linker-name"></a>[`LINKER_NAME`](https://github.com/clickhouse/clickhouse/blob/master/cmake/tools.cmake#L42) | `OFF` | Linker name or full path | || <a name="enable-ssl"></a>[`ENABLE_SSL`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/ssl.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable ssl | |
| <a name="use-internal-ssl-library"></a>[`USE_INTERNAL_SSL_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/ssl.cmake#L3) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system *ssl library instead of bundled | || <a name="enable-gperf"></a>[`ENABLE_GPERF`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/gperf.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Use gperf function hash generator tool | || <a name="use-internal-sparsehash-library"></a>[`USE_INTERNAL_SPARSEHASH_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/sparsehash.cmake#L0) | `ON` | Set to FALSE to use system sparsehash library instead of bundled | || <a name="enable-base"></a>[`ENABLE_BASE64`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/base64.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable base64 | || <a name="use-internal-re-library"></a>[`USE_INTERNAL_RE2_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/re2.cmake#L0) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system re2 library instead of bundled [slower] | || <a name="enable-h"></a>[`ENABLE_H3`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/h3.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable H3 | |
| <a name="use-internal-h-library"></a>[`USE_INTERNAL_H3_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/h3.cmake#L2) | `ON` | Set to FALSE to use system h3 library instead of bundled | || <a name="enable-opencl"></a>[`ENABLE_OPENCL`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/opencl.cmake#L2) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable OpenCL support | || <a name="use-internal-libcxx-library"></a>[`USE_INTERNAL_LIBCXX_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/cxx.cmake#L3) | [`USE_INTERNAL_LIBCXX_LIBRARY_DEFAULT`](#use-internal-libcxx-library-default) | Set to FALSE to use system libcxx and libcxxabi libraries instead of bundled | |
| <a name="use-libcxx"></a>[`USE_LIBCXX`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/cxx.cmake#L0) | [`NOT_UNBUNDLED`](#not-unbundled) | Use libc++ and libc++abi instead of libstdc++ | || <a name="enable-mysql"></a>[`ENABLE_MYSQL`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/mysqlclient.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable MySQL | |
| <a name="enable-mysql"></a>[`ENABLE_MYSQL`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/mysqlclient.cmake#L1) | `FALSE` | Enable MySQL | |
| <a name="use-internal-mysql-library"></a>[`USE_INTERNAL_MYSQL_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/mysqlclient.cmake#L7) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system mysqlclient library instead of bundled | || <a name="use-internal-zlib-library"></a>[`USE_INTERNAL_ZLIB_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/zlib.cmake#L0) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system zlib library instead of bundled | || <a name="use-simdjson"></a>[`USE_SIMDJSON`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/simdjson.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Use simdjson | || <a name="use-internal-snappy-library"></a>[`USE_INTERNAL_SNAPPY_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/snappy.cmake#L3) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system snappy library instead of bundled | |
| <a name="use-snappy"></a>[`USE_SNAPPY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/snappy.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable support of snappy library | || <a name="use-sentry"></a>[`USE_SENTRY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/sentry.cmake#L4) | [`ENABLE_LIBRARIES`](#enable-libraries) | Use Sentry | || <a name="use-internal-zstd-library"></a>[`USE_INTERNAL_ZSTD_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/zstd.cmake#L0) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system zstd library instead of bundled | || <a name="enable-ldap"></a>[`ENABLE_LDAP`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/ldap.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable LDAP | |
| <a name="use-internal-ldap-library"></a>[`USE_INTERNAL_LDAP_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/ldap.cmake#L7) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system *LDAP library instead of bundled | || <a name="enable-curl"></a>[`ENABLE_CURL`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/curl.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable curl | |
| <a name="use-internal-curl"></a>[`USE_INTERNAL_CURL`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/curl.cmake#L3) | [`NOT_UNBUNDLED`](#not-unbundled) | Use internal curl library | || <a name="enable-odbc"></a>[`ENABLE_ODBC`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/odbc.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable ODBC library | |
| <a name="use-internal-odbc-library"></a>[`USE_INTERNAL_ODBC_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/odbc.cmake#L10) | [`NOT_UNBUNDLED`](#not-unbundled) | Use internal ODBC library | || <a name="use-internal-libxml-library"></a>[`USE_INTERNAL_LIBXML2_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/libxml2.cmake#L0) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system libxml2 library instead of bundled | || <a name="enable-stats"></a>[`ENABLE_STATS`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/stats.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enalbe StatsLib library | || <a name="enable-avro"></a>[`ENABLE_AVRO`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/avro.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable Avro | |
| <a name="use-internal-avro-library"></a>[`USE_INTERNAL_AVRO_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/avro.cmake#L3) | `ON` | Set to FALSE to use system avro library instead of bundled | || <a name="enable-gtest-library"></a>[`ENABLE_GTEST_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/gtest.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable gtest library | |
| <a name="use-internal-gtest-library"></a>[`USE_INTERNAL_GTEST_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/gtest.cmake#L3) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system Google Test instead of bundled | || <a name="enable-amqpcpp"></a>[`ENABLE_AMQPCPP`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/amqpcpp.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enalbe AMQP-CPP | || <a name="enable-icu"></a>[`ENABLE_ICU`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/icu.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable ICU | |
| <a name="enable-icu"></a>[`ENABLE_ICU`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/icu.cmake#L1) | `0` | Enable ICU | |
| <a name="use-internal-icu-library"></a>[`USE_INTERNAL_ICU_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/icu.cmake#L7) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system ICU library instead of bundled | || <a name="enable-ccache"></a>[`ENABLE_CCACHE`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/ccache.cmake#L6) | [`ENABLE_CCACHE_BY_DEFAULT`](#enable-ccache-by-default) | Speedup re-compilations using ccache | || <a name="enable-parquet"></a>[`ENABLE_PARQUET`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/parquet.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable parquet | |
| <a name="use-internal-parquet-library"></a>[`USE_INTERNAL_PARQUET_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/parquet.cmake#L2) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system parquet library instead of bundled | || <a name="use-unwind"></a>[`USE_UNWIND`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/unwind.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable libunwind (better stacktraces) | || <a name="enable-brotli"></a>[`ENABLE_BROTLI`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/brotli.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable brotli | |
| <a name="use-internal-brotli-library"></a>[`USE_INTERNAL_BROTLI_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/brotli.cmake#L3) | [`USE_STATIC_LIBRARIES`](#use-static-libraries) | Set to FALSE to use system libbrotli library instead of bundled | |
| <a name="use-internal-brotli-library"></a>[`USE_INTERNAL_BROTLI_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/brotli.cmake#L3) | `ON` | Set to FALSE to use system libbrotli library instead of bundled | || <a name="enable-msgpack"></a>[`ENABLE_MSGPACK`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/msgpack.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable msgpack library | |
| <a name="use-internal-msgpack-library"></a>[`USE_INTERNAL_MSGPACK_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/msgpack.cmake#L3) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system msgpack library instead of bundled | || <a name="enable-embedded-compiler"></a>[`ENABLE_EMBEDDED_COMPILER`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/llvm.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Set to TRUE to enable support for 'compile_expressions' option for query execution | |
| <a name="llvm-has-rtti"></a>[`LLVM_HAS_RTTI`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/llvm.cmake#L39) | `ON` | Enable if LLVM was build with RTTI enabled | |
| <a name="use-internal-llvm-library"></a>[`USE_INTERNAL_LLVM_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/llvm.cmake#L7) | [`NOT_UNBUNDLED`](#not-unbundled) | Use bundled or system LLVM library. | || <a name="enable-hdfs"></a>[`ENABLE_HDFS`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/hdfs3.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable HDFS | |
| <a name="use-internal-hdfs-library"></a>[`USE_INTERNAL_HDFS3_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/hdfs3.cmake#L2) | `ON` | Set to FALSE to use system HDFS3 instead of bundled (experimental - set to OFF on your own risk) | || <a name="enable-gsasl-library"></a>[`ENABLE_GSASL_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/libgsasl.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable gsasl library | |
| <a name="use-internal-libgsasl-library"></a>[`USE_INTERNAL_LIBGSASL_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/libgsasl.cmake#L3) | [`USE_STATIC_LIBRARIES`](#use-static-libraries) | Set to FALSE to use system libgsasl library instead of bundled | |
| <a name="use-internal-libgsasl-library"></a>[`USE_INTERNAL_LIBGSASL_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/libgsasl.cmake#L3) | `ON` | Set to FALSE to use system libgsasl library instead of bundled | || <a name="enable-fastops"></a>[`ENABLE_FASTOPS`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/fastops.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable fast vectorized mathematical functions library by Mikhail Parakhin | || <a name="enable-rdkafka"></a>[`ENABLE_RDKAFKA`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/rdkafka.cmake#L2) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable kafka | |
| <a name="use-internal-rdkafka-library"></a>[`USE_INTERNAL_RDKAFKA_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/rdkafka.cmake#L10) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system librdkafka instead of the bundled | || <a name="enable-orc"></a>[`ENABLE_ORC`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/orc.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable ORC | |
| <a name="use-internal-orc-library"></a>[`USE_INTERNAL_ORC_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/orc.cmake#L3) | `ON` | Set to FALSE to use system ORC instead of bundled (experimental set to OFF on your own risk) | || <a name="enable-cassandra"></a>[`ENABLE_CASSANDRA`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/cassandra.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable Cassandra | || <a name="enable-s"></a>[`ENABLE_S3`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/s3.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable S3 | |
| <a name="use-internal-aws-s-library"></a>[`USE_INTERNAL_AWS_S3_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/s3.cmake#L2) | `ON` | Set to FALSE to use system S3 instead of bundled (experimental set to OFF on your own risk) | || <a name="enable-rapidjson"></a>[`ENABLE_RAPIDJSON`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/rapidjson.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Use rapidjson | |
| <a name="use-internal-rapidjson-library"></a>[`USE_INTERNAL_RAPIDJSON_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/rapidjson.cmake#L2) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system rapidjson library instead of bundled | || <a name="use-internal-poco-library"></a>[`USE_INTERNAL_POCO_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/poco.cmake#L0) | `ON` | Use internal Poco library | || <a name="enable-grpc"></a>[`ENABLE_GRPC`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/grpc.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Use gRPC | |
| <a name="use-internal-grpc-library"></a>[`USE_INTERNAL_GRPC_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/grpc.cmake#L3) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system gRPC library instead of bundled. (Experimental. Set to OFF on your own risk) | || <a name="enable-protobuf"></a>[`ENABLE_PROTOBUF`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/protobuf.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable protobuf | |
| <a name="use-internal-protobuf-library"></a>[`USE_INTERNAL_PROTOBUF_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/protobuf.cmake#L3) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system protobuf instead of bundled | || <a name="enable-capnp"></a>[`ENABLE_CAPNP`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/capnp.cmake#L0) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable Cap'n Proto | |
| <a name="use-internal-capnp-library"></a>[`USE_INTERNAL_CAPNP_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/capnp.cmake#L3) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system capnproto library instead of bundled | || <a name="enable-multitarget-code"></a>[`ENABLE_MULTITARGET_CODE`](https://github.com/clickhouse/clickhouse/blob/master/src/Functions/CMakeLists.txt#L117) | `ON` | | |
| <a name="strip-debug-symbols-functions"></a>[`STRIP_DEBUG_SYMBOLS_FUNCTIONS`](https://github.com/clickhouse/clickhouse/blob/master/src/Functions/CMakeLists.txt#L64) | [`STRIP_DSF_DEFAULT`](#strip-dsf-default) | Do not generate debugger info for ClickHouse functions. Provides faster linking and lower binary size. Tradeoff is the inability to debug some source files with e.g. gdb (empty stack frames and no local variables). | || <a name="enable-clickhouse-all"></a>[`ENABLE_CLICKHOUSE_ALL`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L8) | `ON` | Enable all tools | |
| <a name="enable-clickhouse-benchmark"></a>[`ENABLE_CLICKHOUSE_BENCHMARK`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L12) | [`ENABLE_CLICKHOUSE_ALL`](#enable-clickhouse-all) | Enable clickhouse-benchmark | |
| <a name="enable-clickhouse-client"></a>[`ENABLE_CLICKHOUSE_CLIENT`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L10) | [`ENABLE_CLICKHOUSE_ALL`](#enable-clickhouse-all) | Enable clickhouse-client | |
| <a name="enable-clickhouse-compressor"></a>[`ENABLE_CLICKHOUSE_COMPRESSOR`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L14) | [`ENABLE_CLICKHOUSE_ALL`](#enable-clickhouse-all) | Enable clickhouse-compressor | |
| <a name="enable-clickhouse-copier"></a>[`ENABLE_CLICKHOUSE_COPIER`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L15) | [`ENABLE_CLICKHOUSE_ALL`](#enable-clickhouse-all) | Enable clickhouse-copier | |
| <a name="enable-clickhouse-extract-from-config"></a>[`ENABLE_CLICKHOUSE_EXTRACT_FROM_CONFIG`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L13) | [`ENABLE_CLICKHOUSE_ALL`](#enable-clickhouse-all) | Enable clickhouse-extract-from-config | |
| <a name="enable-clickhouse-format"></a>[`ENABLE_CLICKHOUSE_FORMAT`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L16) | [`ENABLE_CLICKHOUSE_ALL`](#enable-clickhouse-all) | Enable clickhouse-format | |
| <a name="enable-clickhouse-install"></a>[`ENABLE_CLICKHOUSE_INSTALL`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L21) | [`ENABLE_CLICKHOUSE_ALL`](#enable-clickhouse-all) | Enable clickhouse-install | |
| <a name="enable-clickhouse-install"></a>[`ENABLE_CLICKHOUSE_INSTALL`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L21) | `OFF` | Enable clickhouse-install | |
| <a name="enable-clickhouse-local"></a>[`ENABLE_CLICKHOUSE_LOCAL`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L11) | [`ENABLE_CLICKHOUSE_ALL`](#enable-clickhouse-all) | Enable clickhouse-local | |
| <a name="enable-clickhouse-obfuscator"></a>[`ENABLE_CLICKHOUSE_OBFUSCATOR`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L17) | [`ENABLE_CLICKHOUSE_ALL`](#enable-clickhouse-all) | Enable clickhouse-obfuscator | |
| <a name="enable-clickhouse-odbc-bridge"></a>[`ENABLE_CLICKHOUSE_ODBC_BRIDGE`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L18) | [`ENABLE_CLICKHOUSE_ALL`](#enable-clickhouse-all) | Enable clickhouse-odbc-bridge | |
| <a name="enable-clickhouse-server"></a>[`ENABLE_CLICKHOUSE_SERVER`](https://github.com/clickhouse/clickhouse/blob/master/programs/CMakeLists.txt#L9) | [`ENABLE_CLICKHOUSE_ALL`](#enable-clickhouse-all) | Enable clickhouse-server | |## Developer's guide for adding new CMake options
### Don't be obvious. Be informative.

View File

@ -13,15 +13,15 @@ footer_file_name: str = "cmake_files_footer.md"
ch_master_url: str = "https://github.com/clickhouse/clickhouse/blob/master/"
name_str: str = "<a name=\"{anchor}\"></a>(`{name}`)[" + ch_master_url + "{path}#L{line}]"
default_anchor_str: str = "(`{name}`)[#{anchor}]"
name_str: str = "<a name=\"{anchor}\"></a>[`{name}`](" + ch_master_url + "{path}#L{line})"
default_anchor_str: str = "[`{name}`](#{anchor})"
def build_entity(path: str, entity: Entity, line_comment: Tuple[int, str]) -> str:
(line, comment) = line_comment
(_name, description, default) = entity
(_name, _description, default) = entity
def anchor(t: str) -> str:
return ''.join([i.lower() for i in t if i.isalpha() or i == "_"])
return "".join(["-" if i == "_" else i.lower() for i in t if i.isalpha() or i == "_"])
if (len(default) == 0):
default = "`OFF`"
@ -39,11 +39,11 @@ def build_entity(path: str, entity: Entity, line_comment: Tuple[int, str]) -> st
path=path,
line=line)
description: str = "".join(_description.split("\n"))
return "| " + name + " | " + default + " | " + description + " | " + comment + " |"
def process_file(input_name: str) -> List[str]:
print("Processing", input_name)
out: List[str] = []
with open(input_name, 'r') as cmake_file:
@ -57,12 +57,12 @@ def process_file(input_name: str) -> List[str]:
if line.find(target) == -1:
continue
for maybe_comment_line in contents_list[n::-1]:
if (re.match("\s*#\s*", maybe_comment_line)):
comment = re.sub("\s*#\s*", "", maybe_comment_line) + "\n" + comment
else:
for maybe_comment_line in contents_list[n - 1::-1]:
if not re.match("\s*#\s*", maybe_comment_line):
break
comment = re.sub("\s*#\s*", "", maybe_comment_line) + ". " + comment
return n, comment
matches: Optional[List[Entity]] = re.findall(cmake_option_regex, contents, re.MULTILINE)
@ -78,8 +78,6 @@ def write_file(output: TextIO, in_file_name: str) -> None:
def process_folder(output: TextIO, name: str) -> None:
for root, _, files in os.walk(name):
print("Processing ", root)
for f in files:
if f == "CMakeLists.txt" or ".cmake" in f:
write_file(output, root + "/" + f)