Currently, find_package_license() checks whether a package has a license-file on every iteration through its read_dir() loop, but only if the current file doesn't have a recognized license name. Because the order in which read_dir() returns its values is filesystem-dependent (and may as well be non-deterministic), this can lead to situations like generic being set to the license-file and then later being reset to a generic license file if that happens to be the last file yielded. Presumably, what you want to happen is for generic to be set to the license-file if no generic license is found in the whole directory, which is what this PR accomplishes.
Currently,
find_package_license()
checks whether a package has alicense-file
on every iteration through itsread_dir()
loop, but only if the current file doesn't have a recognized license name. Because the order in whichread_dir()
returns its values is filesystem-dependent (and may as well be non-deterministic), this can lead to situations likegeneric
being set to thelicense-file
and then later being reset to a generic license file if that happens to be the last file yielded. Presumably, what you want to happen is forgeneric
to be set to thelicense-file
if no generic license is found in the whole directory, which is what this PR accomplishes.