Help with find_package with nested libs

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:

  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)

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.