export: Refactor obtaining export information

Refactor methods in the build and install export file generators to have
the same, simplified API. Expose the resulting method as an abstract
method on the base class, so that it can be called from mode-agnostic
generators. While we're at it, refactor cmExportInstallFileGenerator's
version to use std::any_of.
6 files changed