diff options
author | Brad King <brad.king@kitware.com> | 2021-04-14 18:46:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-04-14 18:57:03 (GMT) |
commit | dcd604ee621e191acf9e91faab8e47507184d7e9 (patch) | |
tree | 34c28e027233944caff804127d1e9fa0aae48642 /Modules/FindBLAS.cmake | |
parent | 98ef6632d9f7de15472246ccde76a749be0d37ca (diff) | |
download | CMake-dcd604ee621e191acf9e91faab8e47507184d7e9.zip CMake-dcd604ee621e191acf9e91faab8e47507184d7e9.tar.gz CMake-dcd604ee621e191acf9e91faab8e47507184d7e9.tar.bz2 |
Find{BLAS,LAPACK}: Make library variable names more robust
Diffstat (limited to 'Modules/FindBLAS.cmake')
-rw-r--r-- | Modules/FindBLAS.cmake | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 61e92c9..c23e41b 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -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() |