# How to handle duplicated target names

**URL:** <https://discourse.cmake.org/t/how-to-handle-duplicated-target-names/13225>\
**Category:** Code\
**Created:** [December 18, 2024, 5:02pm UTC](https://discourse.cmake.org/t/how-to-handle-duplicated-target-names/13225 "2024-12-18T17:02:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beanavil](https://discourse.cmake.org/user_avatar/discourse.cmake.org/beanavil/32/3659_2.png) [@Beanavil](https://discourse.cmake.org/u/Beanavil)\
**Post date:** [December 18, 2024, 5:02pm UTC](https://discourse.cmake.org/t/how-to-handle-duplicated-target-names/13225/1 "2024-12-18T17:02:32Z")

</div>

I have a C++ program that depends on two packages, A and B. Now both have internally a dependency on C (so A-\>C and B-\>C). When I find\_package(A) some targets are defined as a result of it internally doing a find\_dependency(C), but then doing find\_package(B) results on an error because those targets are being imported again.

I don’t really have control on the internals of these A and B libraries. What would be the best way to solve this?
