Skip to content

Support for CMake #411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

AndreyAlifanov
Copy link
Contributor

@AndreyAlifanov AndreyAlifanov commented Feb 17, 2025

Normal support for using library clickhouse-cpp with CMake and vcpkg added. Also some errors fixed.

Current usage of library in projects requires writing many lines of code, sush as
find_library, find_package, include_directories, target_link_libraries for all dependencies.
It's very annoying and error prune.

find_library(CLICKHOUSE_CPP libclickhouse-cpp-lib.a REQUIRED)
find_package(zstd CONFIG REQUIRED)
find_package(lz4 CONFIG REQUIRED)
find_package(cityhash CONFIG REQUIRED)
find_package(abseil CONFIG REQUIRED)

target_link_libraries(${PROJECT_NAME}
  PRIVATE
    ${CLICKHOUSE_CPP}
    zstd::libzstd_static
    lz4::lz4
    cityhash
    abseil
)

With my corrections all we need is:

find_package(clickhouse-cpp CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE clickhouse-cpp-lib)

@Enmk
Copy link
Contributor

Enmk commented Feb 17, 2025

Hi @AndreyAlifanov all CI jobs have failed, could you please take a look?

@AndreyAlifanov
Copy link
Contributor Author

Hi @AndreyAlifanov all CI jobs have failed, could you please take a look?

Hi @Enmk thank you for information. All CI jobs failed with the same errors. I'll investigate reasons.

@AndreyAlifanov
Copy link
Contributor Author

Hi @Enmk hope I fixed build. My local builds are successful with and without WITH_SYSTEM_xxx.

@IyeOnline
Copy link

Hi, I'd like to ask what the status of this is.

I'm currently working on integrating with clickhouse (tenzir/tenzir#5032) and would prefer to "properly" install clickhouse-cpp using this PR.

@AndreyAlifanov
Copy link
Contributor Author

Hi, @Enmk .

I want to know: why this PR hangs? What reasons prevent merge into main repository?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants