Skip to content

Commit 552c3ba

Browse files
committed
Merge pull request opencv#10230 from vpisarev:macos_detect_lapack
2 parents 5b41599 + b833d51 commit 552c3ba

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cmake/OpenCVFindLAPACK.cmake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,18 @@ macro(ocv_lapack_check)
3131
else()
3232
# adding proxy opencv_lapack.h header
3333
set(CBLAS_H_PROXY_PATH ${CMAKE_BINARY_DIR}/opencv_lapack.h)
34-
set(_lapack_include_str "extern \"C\" {\n\#include \"${OPENCV_CBLAS_H_PATH_${_lapack_impl}}\"")
34+
if(APPLE)
35+
set(_lapack_include_str_extern_C "")
36+
set(_lapack_include_str_extern_C_end "")
37+
else()
38+
set(_lapack_include_str_extern_C "extern \"C\" {\n")
39+
set(_lapack_include_str_extern_C_end "}\n")
40+
endif()
41+
set(_lapack_include_str "${_lapack_include_str_extern_C}\#include \"${OPENCV_CBLAS_H_PATH_${_lapack_impl}}\"")
3542
if(NOT "${OPENCV_CBLAS_H_PATH_${_lapack_impl}}" STREQUAL "${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}")
3643
set(_lapack_include_str "${_lapack_include_str}\n#include \"${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}\"")
3744
endif()
38-
set(_lapack_include_str "${_lapack_include_str}\n}\n")
45+
set(_lapack_include_str "${_lapack_include_str}\n${_lapack_include_str_extern_C_end}")
3946
# update file contents (if required)
4047
set(__content_str "")
4148
if(EXISTS "${CBLAS_H_PROXY_PATH}")

0 commit comments

Comments
 (0)