mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00

Historically, find_package() does not guarantee the order in which directories matching a search path containing a glob expression are processed in - the "first valid package" will be selected if there are multiple candidates. In such cases, which package is chosen is completely random and can change, potentially leading to build failures and reproducibility issues. This is rather unexpected and confusing for developers. Now that CMake has bumped its major version, it's a good time to change default sort order and direction could be changed to natural sorting with a descending order. That will result in the newest version of a library being picked in case there are multiple ones available.