CMake List of all Project Targets

I personally think this is something cmake should be able to tell us, instead of users trying to re-invent the wheel, as as proven in this discussion it seems hard. In case makefiles are generated, make does seems to know it since it allows tab completion on the targets, also something not possible when invoking via cmake --build --target.
I assume cmake when generating the build system has full view on it and this information is somewhere also present in the cmake cache ?
There are many scenarios to think of which can start by just having this information, in several build automations and CI scenarios.

Could this please be provided ?

1 Like