# Help with find\_package with nested libs

**URL:** https://discourse.cmake.org/t/help-with-find-package-with-nested-libs/7014
**Category:** Usage
**Created:** [December 5, 2022, 12:28pm UTC](https://discourse.cmake.org/t/help-with-find-package-with-nested-libs/7014 "2022-12-05T12:28:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![randaz81](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/ee7513/32.png) [@randaz81](https://discourse.cmake.org/u/randaz81)
#### Post date: [December 5, 2022, 12:28pm UTC](https://discourse.cmake.org/t/help-with-find-package-with-nested-libs/7014/1 "2022-12-05T12:28:36Z")

</div>

I am a CMake beginner and I’m a bit confused with the find\_package command when using nested libraries.

In my project, I used the following command:

`find_package(aaa COMPONENTS bbb REQUIRED)`

bbb is correctly found, but then I cannot proceed because of this error that puzzles me:

```auto
  The following imported targets are referenced, but are missing:
  ccc

```

ccc is the name of another library, that is linked by bbb. It’s a low-level library and I think that the author of bbb wanted to keep it private when he designed it.

So, how can I proceed to use bbb without “exposing” ccc?

(Btw, I tried to " hack" its cmakelists.txt to expose it, but then I got the same issue with many other libs, i.e. ddd, eee, etc. internally used by ccc)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 5, 2022, 10:08pm UTC](https://discourse.cmake.org/t/help-with-find-package-with-nested-libs/7014/2 "2022-12-05T22:08:35Z")

</div>

_If_ the `ccc` library only brings compile usage requirements (i.e., no `IMPORTED` targets to link to or the like), linking `$<BUILD_INTERFACE:ccc>` would keep it from its _install_. Wtih CMake 3.26 will have `$<BUILD_LOCAL_INTERFACE>` to hide it from all exports.
