fix handling of cmake packages which do not install any files

@tfoote Please verify that it fixes your problem reported in #665.