How to determine whether the dependency is on the other project module?

I need to filter project module dependencies in multi module build. Is there any way to define that a dependency is a project module dependency?