Commit dcd604ee authored by Brad King's avatar Brad King 💬
Browse files

Find{BLAS,LAPACK}: Make library variable names more robust

parent 98ef6632
......@@ -235,20 +235,21 @@ function(CHECK_BLAS_LIBRARIES LIBRARIES _prefix _name _flags _list _deps _addlib
# Respect linker flags as-is (required by MKL)
list(APPEND _libraries "${_library}")
else()
set(_combined_name ${_combined_name}_${_library})
string(REGEX REPLACE "[^A-Za-z0-9]" "_" _lib_var "${_library}")
set(_combined_name ${_combined_name}_${_lib_var})
if(NOT "${_deps}" STREQUAL "")
set(_combined_name ${_combined_name}_deps)
endif()
if(_libraries_work)
find_library(${_prefix}_${_library}_LIBRARY
find_library(${_prefix}_${_lib_var}_LIBRARY
NAMES ${_library}
NAMES_PER_DIR
PATHS ${_extaddlibdir}
PATH_SUFFIXES ${_subdirs}
)
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
list(APPEND _libraries ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
mark_as_advanced(${_prefix}_${_lib_var}_LIBRARY)
list(APPEND _libraries ${${_prefix}_${_lib_var}_LIBRARY})
set(_libraries_work ${${_prefix}_${_lib_var}_LIBRARY})
endif()
endif()
endforeach()
......
......@@ -217,20 +217,21 @@ function(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _deps _addl
# Respect linker flags as-is (required by MKL)
list(APPEND _libraries "${_library}")
else()
set(_combined_name ${_combined_name}_${_library})
string(REGEX REPLACE "[^A-Za-z0-9]" "_" _lib_var "${_library}")
set(_combined_name ${_combined_name}_${_lib_var})
if(NOT "${_deps}" STREQUAL "")
set(_combined_name ${_combined_name}_deps)
endif()
if(_libraries_work)
find_library(${_prefix}_${_library}_LIBRARY
find_library(${_prefix}_${_lib_var}_LIBRARY
NAMES ${_library}
NAMES_PER_DIR
PATHS ${_extaddlibdir}
PATH_SUFFIXES ${_subdirs}
)
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
list(APPEND _libraries ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
mark_as_advanced(${_prefix}_${_lib_var}_LIBRARY)
list(APPEND _libraries ${${_prefix}_${_lib_var}_LIBRARY})
set(_libraries_work ${${_prefix}_${_lib_var}_LIBRARY})
endif()
endif()
endforeach()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment