Skip to content

add_library(Rdkafka::rdkafka) issue #308

@mohammad-nazari

Description

@mohammad-nazari

Hi,

Ubuntu version: 22.04
CppKafka version: 0.4.0
CMake version: 3.25.2

Imagine we have a project with two sub-projects 'foo' and 'bar'. Both of them use the CppKafka. They have the command 'find_package(CppKafka REQUIRED)' in their CMakeLists.txt file. Cmake gets this error:
CMake Error at /usr/local/lib/cmake/CppKafka/FindRdKafka.cmake:57 (add_library): add_library cannot create imported target "RdKafka::rdkafka" because another target with the same name already exists.
It occurs if we have more than one calling 'find_package(CppKafka REQUIRED)' command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions