summaryrefslogtreecommitdiffstats
path: root/Modules/FindBLAS.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindBLAS.cmake')
-rw-r--r--Modules/FindBLAS.cmake16
1 files changed, 9 insertions, 7 deletions
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 510f47d..fafbc0f 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -236,23 +236,25 @@ macro(CHECK_BLAS_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _add
endif()
list(APPEND _extaddlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
- foreach(_library ${_list} ${_threadlibs})
+ foreach(_library ${_list})
if(_library MATCHES "^-Wl,--(start|end)-group$")
# Respect linker flags like --start/end-group (required by MKL)
set(${LIBRARIES} ${${LIBRARIES}} "${_library}")
else()
- string(REGEX REPLACE "[^A-Za-z0-9]" "_" _lib_var "${_library}")
- set(_combined_name ${_combined_name}_${_lib_var})
+ set(_combined_name ${_combined_name}_${_library})
+ if(NOT "${_threadlibs}" STREQUAL "")
+ set(_combined_name ${_combined_name}_threadlibs)
+ endif()
if(_libraries_work)
- find_library(${_prefix}_${_lib_var}_LIBRARY
+ find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
NAMES_PER_DIR
PATHS ${_extaddlibdir}
PATH_SUFFIXES ${_subdirs}
)
- mark_as_advanced(${_prefix}_${_lib_var}_LIBRARY)
- set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_lib_var}_LIBRARY})
- set(_libraries_work ${${_prefix}_${_lib_var}_LIBRARY})
+ mark_as_advanced(${_prefix}_${_library}_LIBRARY)
+ set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
+ set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
endif()
endif()
endforeach()