From 318fee83895ba6c13e44d08954de5801e411e632 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Tue, 15 Aug 2017 09:57:09 +0800 Subject: [PATCH] refine cblas --- cmake/external/openblas.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/external/openblas.cmake b/cmake/external/openblas.cmake index d47eabba44b..0eeccbf7d8a 100644 --- a/cmake/external/openblas.cmake +++ b/cmake/external/openblas.cmake @@ -73,17 +73,18 @@ INCLUDE_DIRECTORIES(${CBLAS_INC_DIR}) # linear algebra libraries for cc_library(xxx SRCS xxx.c DEPS cblas) SET(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/cblas_dummy.c) FILE(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";") - IF(${CBLAS_PROVIDER} MATCHES MKL) ADD_LIBRARY(cblas SHARED ${dummyfile}) - TARGET_LINK_LIBRARIES(cblas ${CBLAS_LIBRARIES}) - ADD_DEPENDENCIES(cblas mklml) ELSE() ADD_LIBRARY(cblas STATIC ${dummyfile}) - TARGET_LINK_LIBRARIES(cblas ${CBLAS_LIBRARIES}) ENDIF() +TARGET_LINK_LIBRARIES(cblas ${CBLAS_LIBRARIES}) IF(NOT ${CBLAS_FOUND}) ADD_DEPENDENCIES(cblas extern_openblas) LIST(APPEND external_project_dependencies cblas) +ELSE() + IF("${CBLAS_PROVIDER}" STREQUAL "MKLML") + ADD_DEPENDENCIES(cblas mklml) + ENDIF() ENDIF(NOT ${CBLAS_FOUND}) -- GitLab