How do I list components available with `cmake --install . --component ...`?

So I have a top-level CMakeLists.txt authored by “us” (our company) and plenty of subordinate CMakeLists.txt files which were mostly not authored by us.

Most of these contain an install(). Seemingly dozens if not hundreds of components.

Now all the advice I found on how to deal with this told me to pass --component. So I thought: well, this can’t be that hard. First I tried the target name, but apparently that’s a separate concept. And in script I wasn’t able to find whether there was a list of components to output.

So my question is: how can I get the component names from within a given build directory? What I was hoping for is something akin to cmake --install . --component list (or whatever other reserved word could be used to see the list). … without having to scour all of these “other” CMakeLists.txt, which isn’t trivial.

Thank you!