cmake: fix LAPACK/MKL detection

This commit is contained in:
Alexander Alekhin 2017-10-13 15:40:37 +03:00
parent 1ba29cc95d
commit 23f26fb4a8

View File

@ -121,7 +121,8 @@ if(WITH_LAPACK)
set(LAPACK_IMPL "LAPACK/MKL") set(LAPACK_IMPL "LAPACK/MKL")
ocv_lapack_check() ocv_lapack_check()
endif() endif()
if(LAPACKE_INCLUDE_DIR AND NOT HAVE_LAPACK) if(NOT HAVE_LAPACK)
if(LAPACKE_INCLUDE_DIR)
set(LAPACK_INCLUDE_DIR ${LAPACKE_INCLUDE_DIR}) set(LAPACK_INCLUDE_DIR ${LAPACKE_INCLUDE_DIR})
set(LAPACK_CBLAS_H "cblas.h") set(LAPACK_CBLAS_H "cblas.h")
set(LAPACK_LAPACKE_H "lapacke.h") set(LAPACK_LAPACKE_H "lapacke.h")
@ -132,12 +133,10 @@ if(WITH_LAPACK)
set(LAPACK_LAPACKE_H "Accelerate/Accelerate.h") set(LAPACK_LAPACKE_H "Accelerate/Accelerate.h")
set(LAPACK_IMPL "LAPACK/Apple") set(LAPACK_IMPL "LAPACK/Apple")
ocv_lapack_check() ocv_lapack_check()
else()
unset(LAPACK_LIBRARIES)
unset(LAPACK_LIBRARIES CACHE)
endif() endif()
else() endif()
# LAPACK not found endif()
if(NOT HAVE_LAPACK)
unset(LAPACK_LIBRARIES) unset(LAPACK_LIBRARIES)
unset(LAPACK_LIBRARIES CACHE) unset(LAPACK_LIBRARIES CACHE)
endif() endif()