Listing available targets with cmake ?


I can use cmake from the command line to configure a project, to build it and to install it.
But is there a way to list all buildable targets ?
When using makefiles, I can do “make help”, with ninja I can do “ninja -t targets all”.
But is there something generic like “cmake --list-targets” ?

Otherwise it’s kind of hard to find the name of the target to build with “cmake --build . --target foo”

cmake --build . --target help works always or not?

When using the Visual Studio generator it doesn’t work, it complains there is no such project file.