Bump minimum CMake to 3.13 so option() honors parent-set variables (CMP0077)#525
Merged
Conversation
…MP0077)
When clickhouse-cpp is consumed via add_subdirectory(), setting one of its options from the parent
project does not take effect. For example:
set(WITH_OPENSSL ON)
add_subdirectory(contrib/clickhouse-cpp)
The setting is not applied - WITH_OPENSSL stays OFF, i.e. it option silently reverts to the default
declared in its OPTION() call.
The project declared CMAKE_MINIMUM_REQUIRED (VERSION 3.12). Policy CMP0077 ("option() honors
normal variables") was introduced in CMake 3.13, so under 3.12 it is unset and uses OLD behavior:
option() ignores the normal variable set by the parent and overwrites the value with the option's
default. The parent's set() is silently discarded, which is especially misleading for WITH_OPENSSL
(default OFF) since the build still succeeds, just without TLS.
CMake 3.13 (Nov 2018) is available on all currently supported platforms and CI images, so the bump
is low-risk. Standalone configure/build is unaffected.
chernser
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When clickhouse-cpp is consumed via
add_subdirectory(), setting one of its options from the parent project does not take effect. For example:The setting is not applied -
WITH_OPENSSLstaysOFF, i.e. it option silently reverts to the default declared in itsOPTION()call.The project declared
CMAKE_MINIMUM_REQUIRED (VERSION 3.12). Policy CMP0077 (option()honors normal variables) was introduced in CMake 3.13, so under 3.12 it is unset and uses OLD behavior:option()ignores the normal variable set by the parent and overwrites the value with the option's default. The parent'sset()is silently discarded, which is especially misleading forWITH_OPENSSL(defaultOFF) since the build still succeeds, just without TLS.CMake 3.13 (Nov 2018) is available on all currently supported platforms and CI images, so the bump is low-risk. Standalone configure/build is unaffected.