Skip to content

find_package: Use PackageName_ROOT variables as search prefixes

Brad King requested to merge brad.king/cmake:find-package_root-restore into master

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)

Merge request reports