Patching cmake file, from nieder

Fixing issue #301