diff --git a/cmake_flags_and_output.md b/cmake_flags_and_output.md
index cb444517ac8..033cdf3e943 100644
--- a/cmake_flags_and_output.md
+++ b/cmake_flags_and_output.md
@@ -83,42 +83,6 @@ cmake .. \
| [`ENABLE_S3`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/s3.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable S3 | |
| [`ENABLE_SSL`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/ssl.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable ssl | |
| [`ENABLE_STATS`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/stats.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enalbe StatsLib library | |
-| [`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 | |
-| [`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 | |
-| [`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) | |
-| [`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 | |
-| [`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 | |
-| [`USE_INTERNAL_CURL`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/curl.cmake#L3) | [`NOT_UNBUNDLED`](#not-unbundled) | Use internal curl library | |
-| [`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) | |
-| [`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 | |
-| [`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 | |
-| [`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) | |
-| [`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 | |
-| [`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 | |
-| [`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) | Disable to use system libcxx and libcxxabi libraries instead of bundled | |
-| [`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 | |
-| [`USE_INTERNAL_LIBXML2_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/libxml2.cmake#L1) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system libxml2 library instead of bundled | |
-| [`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. | |
-| [`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 | |
-| [`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 | |
-| [`USE_INTERNAL_ODBC_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/odbc.cmake#L10) | [`NOT_UNBUNDLED`](#not-unbundled) | Use internal ODBC library | |
-| [`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) | |
-| [`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 | |
-| [`USE_INTERNAL_POCO_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/poco.cmake#L1) | `ON` | Use internal Poco library | |
-| [`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 | |
-| [`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 | |
-| [`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 | |
-| [`USE_INTERNAL_RE2_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/re2.cmake#L1) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system re2 library instead of bundled [slower] | |
-| [`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 | |
-| [`USE_INTERNAL_SPARSEHASH_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/sparsehash.cmake#L1) | `ON` | Set to FALSE to use system sparsehash library instead of bundled | |
-| [`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 | |
-| [`USE_INTERNAL_ZLIB_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/zlib.cmake#L1) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system zlib library instead of bundled | |
-| [`USE_INTERNAL_ZSTD_LIBRARY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/zstd.cmake#L1) | [`NOT_UNBUNDLED`](#not-unbundled) | Set to FALSE to use system zstd library instead of bundled | |
-| [`USE_LIBCXX`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/cxx.cmake#L1) | [`NOT_UNBUNDLED`](#not-unbundled) | Use libc++ and libc++abi instead of libstdc++ | |
-| [`USE_SENTRY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/sentry.cmake#L5) | [`ENABLE_LIBRARIES`](#enable-libraries) | Use Sentry | |
-| [`USE_SIMDJSON`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/simdjson.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Use simdjson | |
-| [`USE_SNAPPY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/snappy.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable snappy library | |
-| [`USE_UNWIND`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/unwind.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable libunwind (better stacktraces) | |
### External libraries system/bundled mode
| Name | Default value | Description | Comment |
@@ -180,7 +144,12 @@ cmake .. \
| [`STRIP_DEBUG_SYMBOLS_FUNCTIONS`](https://github.com/clickhouse/clickhouse/blob/master/src/Functions/CMakeLists.txt#L67) | [`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)." |
| [`UNBUNDLED`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L154) | `OFF` | Use system libraries instead of ones in contrib/ | |
| [`USE_INCLUDE_WHAT_YOU_USE`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L390) | `OFF` | Automatically reduce unneeded includes in source code (external tool) | https://github.com/include-what-you-use/include-what-you-use |
+| [`USE_LIBCXX`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/cxx.cmake#L1) | [`NOT_UNBUNDLED`](#not-unbundled) | Use libc++ and libc++abi instead of libstdc++ | |
+| [`USE_SENTRY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/sentry.cmake#L5) | [`ENABLE_LIBRARIES`](#enable-libraries) | Use Sentry | |
+| [`USE_SIMDJSON`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/simdjson.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Use simdjson | |
+| [`USE_SNAPPY`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/snappy.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable snappy library | |
| [`USE_STATIC_LIBRARIES`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L95) | `ON` | Disable to use shared libraries | |
+| [`USE_UNWIND`](https://github.com/clickhouse/clickhouse/blob/master/cmake/find/unwind.cmake#L1) | [`ENABLE_LIBRARIES`](#enable-libraries) | Enable libunwind (better stacktraces) | |
| [`WERROR`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L345) | `OFF` | Enable -Werror compiler option | Using system libs can cause a lot of warnings in includes (on macro expansion). |
| [`WEVERYTHING`](https://github.com/clickhouse/clickhouse/blob/master/cmake/warnings.cmake#L21) | `ON` | Enable -Weverything option with some exceptions. | Add some warnings that are not available even with -Wall -Wextra -Wpedantic. Intended for exploration of new compiler warnings that may be found useful. Applies to clang only |
| [`WITH_COVERAGE`](https://github.com/clickhouse/clickhouse/blob/master/CMakeLists.txt#L119) | `OFF` | Profile the resulting binary/binaries | |
diff --git a/cmake_flags_generator.py b/cmake_flags_generator.py
index 96fab878f56..2c79595b564 100755
--- a/cmake_flags_generator.py
+++ b/cmake_flags_generator.py
@@ -116,7 +116,7 @@ def process() -> None:
f.write("### External libraries\n" + table_header)
for k in sorted_keys:
- if (k.startswith("ENABLE_") or k.startswith("USE_")) and entities[k][0].startswith("cmake"):
+ if k.startswith("ENABLE_") and entities[k][0].startswith("cmake"):
f.write(entities[k][1] + "\n")
ignored_keys.append(k)