Skip to content

find_package: Don't reroot prefix that is equal to a root path

alcroito requested to merge alcroito/cmake:fix_reroot_paths into master

When both CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH are set to /opt/my_device_sysroot, cmFindCommon::RerootPaths would only look for packages in /opt/my_device_sysroot/opt/my_device_sysroot but would not try to look in /opt/my_device_sysroot.

Make sure to not reroot the prefix path in such a case.

Fixes: #21937 (closed)

Merge request reports