diff options
author | Brad King <brad.king@kitware.com> | 2021-04-08 11:44:55 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-04-08 11:45:14 (GMT) |
commit | fd873ccaeebb10c483ed93dfabbc009cec24794e (patch) | |
tree | 4cb4ac9c48e4d5d2d6e8446c3e127aa6c2cba708 /Modules/FindBLAS.cmake | |
parent | 8ffd3b49464005b6bb6ba2902616b2e8a5ce3a8d (diff) | |
parent | 9ef82d95d8bab39b354c09139c94a39d49aeab9d (diff) | |
download | CMake-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.cmake | 13 |
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 |