find_package: Use PackageName_ROOT variables as search prefixes
This feature was originally added by !796 (merged). However, we had to disable the feature and remove the documentation in !1116 (merged) due to breaking projects that used PackageName_ROOT
variables themselves.
Add policy CMP0074
to restore the PackageName_ROOT
variable behavior in a compatible way. Also revise the stack of root paths to store the paths themselves rather than the package names. This way the policy can be considered at the find_package
call site instead of individual find_
calls inside a find module.
Issue: #17144 (closed)