confluentinc / librdkafka

The Apache Kafka C/C++ library
Other
258 stars 3.15k forks source link

missing Findlibrdkafka.cmake #3387

Closed alejandro-colomar closed 3 years ago

alejandro-colomar commented 3 years ago

Description

Can't consume librdkafka from project using cmake with find_package().

CMake Error at src/xxx/CMakeLists.txt:96 (find_package):
  By not providing "Findlibrdkafka.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "librdkafka", but CMake did not find one.

  Could not find a package configuration file provided by "librdkafka"
  (requested version 1.6.0) with any of the following names:

    librdkafkaConfig.cmake
    librdkafka-config.cmake

  Add the installation prefix of "librdkafka" to CMAKE_PREFIX_PATH or set
  "librdkafka_DIR" to a directory containing one of the above files.  If
  "librdkafka" provides a separate development package or SDK, be sure it has
  been installed.

-- Configuring incomplete, errors occurred!

How to reproduce

Write in a CMakeLists.txt the following line:

find_package(librdkafka 1.6.0 REQUIRED)

I used version 1.6.0, because it's the latest one provided by conan-center.

Checklist

Please provide the following information:

smadurange commented 3 years ago

I think you need to change librdkafka to rdkafka.

alejandro-colomar commented 3 years ago

It works with RdKafka (but not with rdkafka) :)

Thank you!

Now I don't know how I didn't see that myself.