A quirk for debug symbols on Windows

So I made this module.
It enumerates all targets in the current directory,
for static libraries it sets some variables so that the debug symbols are put to the build directory
(which does not happen by default, they just end up in some subddirectory) and
for shared or static librares and for executables the module installs them with the target.

I really wanted to install the symbols automatically, but only for targets that are being installed.
I went with a quick quirk that checks if the contents of the cmake_install.cmake contains the target name.
I want to clean this up now.

Would someone be so kind to tell:
Is cmake_file_api the best option to find out what is being installed by the project?
What is the idiomatic way to expand the set of artifacts of the target in general?

Thank you.

Would the PDB_OUTPUT_DIRECTORY target property help here?

help with which part?
Fixing the output location for static libraries is straightforward with
That works fine in the link.

How would it help with finding out if a target installed or not? So to add symbols to the installation.
I really do not want to call a separate macro or function for that.
Want it to be seamless and automatic.

Oh, I see. I don’t think there’s a way to query install() commands that have been made, sorry. It can be a new feature request, but it’d likely have to ultimately be a contribution to expose them in some way.