Debugging Targets Added

I am new to CMAKE and I have added a third party library, glfw. It compiles using ExternalProject_Add. This ExternalProject_Add apparently calls the CMake code for glfw and adds a new target to which I can link, but I only know this if I parse their code or if I run something like cmake --build . --target help from the CLI. I want to be able to debug this from within CMAKE, i.e. to either

  1. Get a list of all known targets beforehand in a list. Do the same afterwards, then subtract and print out the extra or
  2. Query the external project for targets which it provides.

I am unable to find help on either of these, please help.

There’s no way to get the list of targets in a build right now. Though I suppose you could use the file-api could probably be used to extract out the information. Note that it won’t be available until the gdal project’s configure step is complete.