summaryrefslogtreecommitdiffstats
path: root/Modules/FindBLAS.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-08 11:44:55 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-04-08 11:45:14 (GMT)
commitfd873ccaeebb10c483ed93dfabbc009cec24794e (patch)
tree4cb4ac9c48e4d5d2d6e8446c3e127aa6c2cba708 /Modules/FindBLAS.cmake
parent8ffd3b49464005b6bb6ba2902616b2e8a5ce3a8d (diff)
parent9ef82d95d8bab39b354c09139c94a39d49aeab9d (diff)
downloadCMake-fd873ccaeebb10c483ed93dfabbc009cec24794e.zip
CMake-fd873ccaeebb10c483ed93dfabbc009cec24794e.tar.gz
CMake-fd873ccaeebb10c483ed93dfabbc009cec24794e.tar.bz2
Merge topic 'FindBLAS-default-OpenMP'
9ef82d95d8 FindBLAS: Fix detection of OpenMP as dependency of BLA_STATIC Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5993
Diffstat (limited to 'Modules/FindBLAS.cmake')
-rw-r--r--Modules/FindBLAS.cmake13
1 files changed, 11 insertions, 2 deletions
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 14a8665..510f47d 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -630,8 +630,17 @@ if(BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All")
endif()
set(_threadlibs "${CMAKE_THREAD_LIBS_INIT}")
if(BLA_STATIC)
- find_package(OpenMP COMPONENTS C)
- list(PREPEND _threadlibs "${OpenMP_C_LIBRARIES}")
+ set(_blas_STATIC_CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}")
+ set(CMAKE_FIND_LIBRARY_SUFFIXES "${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}")
+ if (CMAKE_C_COMPILER_LOADED)
+ find_package(OpenMP COMPONENTS C)
+ list(PREPEND _threadlibs "${OpenMP_C_LIBRARIES}")
+ elseif(CMAKE_CXX_COMPILER_LOADED)
+ find_package(OpenMP COMPONENTS CXX)
+ list(PREPEND _threadlibs "${OpenMP_CXX_LIBRARIES}")
+ endif()
+ set(CMAKE_FIND_LIBRARY_SUFFIXES "${_blas_STATIC_CMAKE_FIND_LIBRARY_SUFFIXES}")
+ unset(_blas_STATIC_CMAKE_FIND_LIBRARY_SUFFIXES)
endif()
check_blas_libraries(
BLAS_LIBRARIES