Skip to content
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

Document zookeeper-cpp CMake integration #119

Open
GuillaumeDua opened this issue Sep 28, 2020 · 1 comment
Open

Document zookeeper-cpp CMake integration #119

GuillaumeDua opened this issue Sep 28, 2020 · 1 comment

Comments

@GuillaumeDua
Copy link

While this project is great, it lacks documentation about how to integrate it into others CMake projects as dependency.
(My bad if it already exists somewhere else, so my point would be that it should be placed in the README.md)

A few samples should do the tricks :

  • FetchContent
    (simple project add_dependency + target_link_library)
  • Compilation options (ZKPP_BUILD_SETTINGS_BUFFER, ZKPP_BUILD_SETTINGS_FUTURE, etc.)
  • How to build (or exclude from build) specific targets : tests, server, etc.
@GuillaumeDua
Copy link
Author

GuillaumeDua commented Oct 16, 2020

Really need some CMake's option directive to select which target are about to be part of the build, and which not.
For instance, some projects which depends on Zookeeper-cpp may only depends on the client.

In order to to this, and get a way cleaner build, I strongly advise you to create a subdirectory + CMakeLists.txt per target, for instance :

zookeeper-cpp
  +- includes/zookeeper-cpp/*.hpp -> common impls
  +- includes/zookeeper-cpp/client/*.hpp
  +- includes/zookeeper-cpp/server/*.hpp
  +- sources
       +- server/CMakeLists.txt -> zkpp-server target
       +- client -> zkpp-client target
  +- tests
       +- server -> zkpp-server-test target
       +- client -> zkpp-client-test target

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

No branches or pull requests

1 participant