mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-30 02:59:22 -05:00
Find{BLAS,LAPACK}: Simplify check_function_exists state maintenance
Now that `CHECK_{BLAS,LAPACK}_LIBRARIES` are functions, we can set
`CMAKE_REQUIRED_QUIET` locally without affecting the global state.
This commit is contained in:
@@ -176,10 +176,7 @@ if(CMAKE_Fortran_COMPILER_LOADED)
|
||||
else()
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
|
||||
endif()
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
cmake_push_check_state()
|
||||
set(CMAKE_REQUIRED_QUIET ${BLAS_FIND_QUIETLY})
|
||||
|
||||
if(BLA_PREFER_PKGCONFIG)
|
||||
find_package(PkgConfig)
|
||||
@@ -261,6 +258,7 @@ function(CHECK_BLAS_LIBRARIES LIBRARIES _prefix _name _flags _list _deps _addlib
|
||||
if(_libraries_work)
|
||||
# Test this combination of libraries.
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${_libraries} ${_deps})
|
||||
set(CMAKE_REQUIRED_QUIET ${BLAS_FIND_QUIETLY})
|
||||
if(CMAKE_Fortran_COMPILER_LOADED)
|
||||
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
|
||||
else()
|
||||
@@ -1086,5 +1084,4 @@ if(NOT BLA_F95)
|
||||
endif()
|
||||
|
||||
_add_blas_target()
|
||||
cmake_pop_check_state()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
Reference in New Issue
Block a user