cmake.eclass: Restrict default rm Find{BLAS,LAPACK}.cmake to CMake <4.2.1

This goes back to ancient cmake-utils.eclass,v 1.70 in CVS of 2011, or
historical.git commit 70230d8d15c0d287b5e81b09a6e78b6aff01b1d6, and it was
done to ensure use of downstream-modified versions of these modules shipped
by Gentoo's cmake package over consumer packages' own copy overriding them.

After commit 04ce4a0355 finally dropped this
downstream modification for CMake >=4.2.1, we can also stop removing these
modules by default.

Closes: https://bugs.gentoo.org/736547
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2026-01-03 23:48:02 +01:00
parent 433b994a81
commit 3f8ff6b53f

View File

@@ -77,10 +77,6 @@ inherit flag-o-matic multiprocessing ninja-utils toolchain-funcs xdg-utils
if [[ ${CMAKE_REMOVE_MODULES_LIST} ]]; then
[[ ${CMAKE_REMOVE_MODULES_LIST@a} == *a* ]] ||
die "CMAKE_REMOVE_MODULES_LIST must be an array"
else
if ! [[ ${CMAKE_REMOVE_MODULES_LIST@a} == *a* && ${#CMAKE_REMOVE_MODULES_LIST[@]} -eq 0 ]]; then
CMAKE_REMOVE_MODULES_LIST=( FindBLAS FindLAPACK )
fi
fi
# @ECLASS_VARIABLE: CMAKE_USE_DIR
@@ -497,6 +493,11 @@ cmake_prepare() {
die "FATAL: Unable to find CMakeLists.txt"
fi
if ! [[ ${CMAKE_REMOVE_MODULES_LIST@a} == *a* && ${#CMAKE_REMOVE_MODULES_LIST[@]} -eq 0 ]]; then
if has_version -b "<dev-build/cmake-4.2.1"; then
CMAKE_REMOVE_MODULES_LIST=( FindBLAS FindLAPACK )
fi
fi
local modules_list=( "${CMAKE_REMOVE_MODULES_LIST[@]}" )
local name