Failed to find valid rdkafka version
I am using Cmake GUI to build the code on window and given the path in path variable as
DBOOST_INCLUDEDIR="C:\packages\boost.1.70.0.0\lib\native\include"
-DRDKAFKA_LIBRARY="C:\packages\librdkafka.redist.1.2.0\build\native\lib\win\x86\win-x86-Release\v120\librdkafka.lib"
-DRDKAFKA_INCLUDE_DIR="C:\packages\librdkafka.redist.1.2.0\build\native\include"
when in configure from camke UI i receive error like
Build will generate a shared library. Use CPPKAFKA_BUILD_SHARED=0 to perform a static build RdKafkaConfig.cmake not found. Attempting to find module instead... CMake Error at cmake/FindRdKafka.cmake:71 (message): Failed to find valid rdkafka version Call Stack (most recent call first): CMakeLists.txt:129 (find_package)
Configuring incomplete, errors occurred! See also "C:/project/1/build1/CMakeFiles/CMakeOutput.log".
what is wrong i am doing .......Please help
I have managed to build it under Windows! So, my solution:
Let's assume, that you've downloaded 'librdkafka' project from github into the following directory:
D:/builds-github/librdkafka/librdkafka-master
(Your CMakeLists.txt will be here: librdkafka-master/CMakeLists.txt)
- Find the
srcfolder (there are*.hand*.cfiles. Also there is one.pngfile in it) - Create folder
librdkafkaunderlibrdkafka-master. In my example:D:/builds-github/librdkafka/librdkafka-master/librdkafka - Copy the content of
srcdirectory intolibrdkafkadirectory. So, the filerdkafka.hwill be here now:D:/builds-github/librdkafka/librdkafka-master/librdkafka/rdkafka.h
I think, the problem is in cmake/FindRdKafka.cmake file at line 20:
NAMES librdkafka/rdkafka.h
Lines 19 to 22:
find_path(RdKafka_INCLUDE_DIR
NAMES librdkafka/rdkafka.h
HINTS ${RdKafka_ROOT}/include
)
And if you are building this library under Windows, disable Tests and Examples.
They require pthread.lib and rt.lib. I have no idea where to get them.
And then in Visual Studio remove these libraries in Project properties (Linker settings)
P.S. I've attached a screenshot of my cmake-gui settings
There is 'RdKafka_ROOT' variable on it, which I've created by adding a new entry, but it isn't neccessary to do that, I think. You might not need it.
