commit:     3f8ff6b53f4c9d048cb677b0e41a4f5089951d5d
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  3 22:48:02 2026 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Jan  5 16:59:46 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f8ff6b5

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 04ce4a03554e3541c587db60013b9b796613c2c7 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 <AT> gentoo.org>

 eclass/cmake.eclass | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index adf50ff5f511..03c54866f2e8 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -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

Reply via email to