cmake: update OpenBLAS support

- reorder path HINTS to avoid conflicts with other LAPACK libraries
- add extern "C" { } to avoid generation of C++ symbols
This commit is contained in:
Alexander Alekhin
2017-10-28 02:22:21 +03:00
parent 7b0d2d189f
commit 5f80e42dac
2 changed files with 20 additions and 19 deletions

View File

@@ -31,10 +31,11 @@ macro(ocv_lapack_check)
else()
# adding proxy opencv_lapack.h header
set(CBLAS_H_PROXY_PATH ${CMAKE_BINARY_DIR}/opencv_lapack.h)
set(_lapack_include_str "\#include \"${OPENCV_CBLAS_H_PATH_${_lapack_impl}}\"")
set(_lapack_include_str "extern \"C\" {\n\#include \"${OPENCV_CBLAS_H_PATH_${_lapack_impl}}\"")
if(NOT "${OPENCV_CBLAS_H_PATH_${_lapack_impl}}" STREQUAL "${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}")
set(_lapack_include_str "${_lapack_include_str}\n#include \"${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}\"")
endif()
set(_lapack_include_str "${_lapack_include_str}\n}\n")
# update file contents (if required)
set(__content_str "")
if(EXISTS "${CBLAS_H_PROXY_PATH}")