[cmake,bugfix] Fixes requiredness of module

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

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