Skip to content

Conflicting 'uninstall' targets with CMake #4881

@Humminghead

Description

@Humminghead

Describe the bug
If you add Poco together with another library via CMake FetchContent_Declare functionality and they both declare an uninstall target cmake will complain with: "add_custom_target cannot create target "uninstall" because another target with the same name already exists."

To Reproduce
Steps to reproduce the behavior (add Poco together with another library via CMake FetchContent_Declare ):

FetchContent_Declare(
    Poco
    GIT_REPOSITORY https://github.com/pocoproject/poco.git
    GIT_TAG main
)

FetchContent_Declare(
    PcapPlusPlus
    GIT_REPOSITORY https://github.com/seladb/PcapPlusPlus.git
    GIT_TAG dev
)

FetchContent_MakeAvailable(    
    PcapPlusPlus
    Poco 
)

Expected behavior
I want use Poco together with PcapPlusPlus library via CMake FetchContent_Declare functionality

Logs
Image

Please add relevant environment information:

  • Ubuntu 20.04
  • POCO Version 1.14.1
  • Third-party product: PcapPlusPlus dev branch (6a49ae5a00b70bbc316b2d2d44205afe91d84021)

Possible solution:
Rename custom target in root CMakeLists.txt:501 from uninstall to uninstall-poco

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions