Prefer SuiteSparse config-mode packages in Find modules
Summary
- Update
FindCHOLMOD.cmake,FindUMFPACK.cmake,FindSPQR.cmake, andFindKLU.cmaketo first attemptfind_package(... CONFIG)before falling back to the existing manual header/library search - SuiteSparse >= 7.0 ships CMake config files with proper imported targets (
SuiteSparse::CHOLMOD, etc.) that carry all transitive dependencies automatically - When config-mode succeeds, the legacy
<PKG>_INCLUDESand<PKG>_LIBRARIESvariables are populated from the imported target so the rest of Eigen's build system works without changes - When config-mode is not available (SuiteSparse < 7.0), the existing manual search runs exactly as before
This is a step toward issue #2387 (removing old Find*.cmake files).
Test plan
Local Docker (GCC 15, CMake 3.31, Debian trixie, C++17):
| Test suite | Tests | Result |
|---|---|---|
| CMake configure | full project |
|
basicstuff |
8 variants |
|
sparse_basic |
2 variants |
|
sparse_product |
5 variants |
|
| Total | 15 tests | 14/15 pass |
Note: The Docker image does not have SuiteSparse installed, so the fallback (manual search) path is exercised. The config-mode path (find_package(... CONFIG QUIET)) silently skips — no behavioral change. GitLab CI confirms full pipeline green.
Partially addresses #2387
Edited by Pavel Guzenfeld