mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix cmake warnings, FindPASTIX/FindPTSCOTCH.
We were getting a lot of warnings due to nested `find_package` calls within `Find***.cmake` files. The recommended approach is to use [`find_dependency`](https://cmake.org/cmake/help/latest/module/CMakeFindDependencyMacro.html) in package configuration files. I made this change for all instances. Case mismatches between `Find<Package>.cmake` and calling `find_package(<PACKAGE>`) also lead to warnings. Fixed for `FindPASTIX.cmake` and `FindSCOTCH.cmake`. `FindBLASEXT.cmake` was broken due to calling `find_package_handle_standard_args(BLAS ...)`. The package name must match, otherwise the `find_package(BLASEXT)` falsely thinks the package wasn't found. I changed to `BLASEXT`, but then also copied that value to `BLAS_FOUND` for compatibility. `FindPastix.cmake` had a typo that incorrectly added `PTSCOTCH` when looking for the `SCOTCH` component. `FindPTSCOTCH` incorrectly added `***-NOTFOUND` to include/library lists, corrupting them. This led to cmake errors down-the-line. Fixes #2288.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
8cf6cb27ba
commit
1cdec38653
@@ -26,6 +26,7 @@
|
||||
|
||||
|
||||
include(CheckFunctionExists)
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
# This macro checks for the existence of the combination of fortran libraries
|
||||
# given by _list. If the combination is found, this macro checks (using the
|
||||
@@ -88,7 +89,7 @@ macro(check_lapack_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _b
|
||||
set(${LIBRARIES} ${_libraries_found})
|
||||
# Some C++ linkers require the f2c library to link with Fortran libraries.
|
||||
# I do not know which ones, thus I just add the f2c library if it is available.
|
||||
find_package( F2C QUIET )
|
||||
find_dependency( F2C QUIET )
|
||||
if ( F2C_FOUND )
|
||||
set(${DEFINITIONS} ${${DEFINITIONS}} ${F2C_DEFINITIONS})
|
||||
set(${LIBRARIES} ${${LIBRARIES}} ${F2C_LIBRARIES})
|
||||
@@ -135,9 +136,9 @@ endmacro()
|
||||
|
||||
# LAPACK requires BLAS
|
||||
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||
find_package(BLAS)
|
||||
find_dependency(BLAS)
|
||||
else()
|
||||
find_package(BLAS REQUIRED)
|
||||
find_dependency(BLAS REQUIRED)
|
||||
endif()
|
||||
|
||||
if (NOT BLAS_FOUND)
|
||||
|
||||
Reference in New Issue
Block a user