diff options
author | Eisuke Kawashima <15070-e-kwsm@users.noreply.gitlab.com> | 2020-11-10 03:05:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-11 14:10:22 (GMT) |
commit | f7f3d8987ad501583031f0e1d5290370542cc1f3 (patch) | |
tree | 50e24c30baa75338044ac30bf3e9715a88ce0b40 /Modules/FindBLAS.cmake | |
parent | caed98d77137b868fdd7b87a837969667e3e6f51 (diff) | |
download | CMake-f7f3d8987ad501583031f0e1d5290370542cc1f3.zip CMake-f7f3d8987ad501583031f0e1d5290370542cc1f3.tar.gz CMake-f7f3d8987ad501583031f0e1d5290370542cc1f3.tar.bz2 |
FindBLAS: Add dependency of OpenBLAS on OpenMP for BLA_STATIC
Fixes: #16221
Diffstat (limited to 'Modules/FindBLAS.cmake')
-rw-r--r-- | Modules/FindBLAS.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index e4353df..715049b 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -586,16 +586,22 @@ if(BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All") else() find_package(Threads REQUIRED) endif() + set(_threadlibs "${CMAKE_THREAD_LIBS_INIT}") + if(BLA_STATIC) + find_package(OpenMP COMPONENTS C) + list(PREPEND _threadlibs "${OpenMP_C_LIBRARIES}") + endif() check_blas_libraries( BLAS_LIBRARIES BLAS sgemm "" "openblas" - "${CMAKE_THREAD_LIBS_INIT}" + "${_threadlibs}" "" "" ) + unset(_threadlibs) endif() endif() |