# Adding libraries from FetchContent to find\_package lookup?

**URL:** <https://discourse.cmake.org/t/adding-libraries-from-fetchcontent-to-find-package-lookup/15214>\
**Category:** Code\
**Created:** [October 3, 2025, 8:36am UTC](https://discourse.cmake.org/t/adding-libraries-from-fetchcontent-to-find-package-lookup/15214 "2025-10-03T08:36:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![retif](https://discourse.cmake.org/user_avatar/discourse.cmake.org/retif/32/1776_2.png) [@retif](https://discourse.cmake.org/u/retif)\
**Post date:** [October 3, 2025, 9:38am UTC](https://discourse.cmake.org/t/adding-libraries-from-fetchcontent-to-find-package-lookup/15214/4 "2025-10-03T09:38:14Z")

</div>

I got lost in your explanation very quickly. But maybe it will make more sense to others, so let’s wait for other replies.

What I didn’t understand is why there would be more than one `FetchContent` for the same dependency in the same project and why would you still try to call `find_package()` _after_ `FetchContent` (_even though you seem to understand that it should not be so_).

As for transitive dependencies - certainly, if a dependency that is resolved with `FetchContent` has dependencies of its own (_and it does not resolve them by itself_), then you would need to resolve them yourself beforehand. I have actually made an example project for a [similar case](https://discourse.cmake.org/t/how-to-set-zlib-root/9765/6) recently, where a project resolves `png` which transitively depends on `zlib`, so you might want to take a loot at that.

In general, I would definitely recommend using a proper package manager for resolving dependencies, such as [vcpkg](https://vcpkg.io/) or [Conan](https://conan.io/).

---

_[View the full topic](https://discourse.cmake.org/t/adding-libraries-from-fetchcontent-to-find-package-lookup/15214)._
