[cmake,bugfix] Fixes requiredness of module

Previously, dependencies were not correctly searched for as
required packages. This patch fixes this.