Prefer SuiteSparse config-mode packages in Find modules

Summary

  • Update FindCHOLMOD.cmake, FindUMFPACK.cmake, FindSPQR.cmake, and FindKLU.cmake to first attempt find_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>_INCLUDES and <PKG>_LIBRARIES variables 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 configures OK
basicstuff 8 variants 7/8 pass (1 pre-existing flaky)
sparse_basic 2 variants 2/2 pass
sparse_product 5 variants 5/5 pass
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

Merge request reports

Loading