tgockel / zookeeper-cpp

A ZooKeeper client for C++.
http://tgockel.github.io/zookeeper-cpp/
Apache License 2.0
148 stars 40 forks source link

Document zookeeper-cpp CMake integration #119

Open GuillaumeDua opened 3 years ago

GuillaumeDua commented 3 years ago

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 :

GuillaumeDua commented 3 years ago

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