Monitor multiple SCMs for changes

Hi there, I am currently working on getting a pipeline running that can do the following:

If changes to A, build A, B, C, D, E, F, G
if changes to B build B, D, E
if changes to C build C, F, G

The idea being everything below a given repo is dependent on the one directly above. Is there a way I can do this in a single pipeline? I’ve tried playing around with the poll SCM build trigger but as far as I know, this only polls a single SCM. I have a bunch of dependent libraries that need to be built after a given change to their dependencies so I want to try to avoid having a pipeline for every combination of library.