[cmake,bugfix] Fixes requiredness of module

Previously, dependencies were not correctly searched for as
required packages. This patch fixes this.
(cherry picked from commit 5039134cfdf3a4ef8739ae8fc9163f14f07c151e)

Signed-off-by: Markus Blatt <markus@dr-blatt.de>