Fix unable to find libraries quietly

If find_package was called with QUIET, none of the variables were set properly even though the package was found.