Dynamically generating add_custom_command dependencies during build time

This would require dyndep support from add_custom_command. It certainly isn’t implemented right now and I don’t know if there are plans at the moment. C++20 modules support will require it, but getting that plumbed through is likely higher on the priority list.

When such support would be available, you’d have to provide a command that would “scan” the work to be done and output a list of files that will be generated later. Something would have to bridge the gap and add the dependencies on the generated files though. Not sure how that’d work off-hand.

Right now, the best you can do is one of:

  • know what files will be generated at configure time (problematic if files can appear/disappear based on source file contents)
  • use a bridging “stamp” file to represent the entirety of the Python generation step (though any Python change will now trigger users of any the files, not just the modified ones)

Cc: @brad.king