未验证 提交 bae32a05 编写于 作者: G gouzil 提交者: GitHub

[cmake] fix file check (#54614)

* [cmake] fix file check error

* [cmake] fix file check
上级 3355c0c0
......@@ -65,16 +65,13 @@ function(download_cusparselt)
endif()
endfunction()
find_file(
LOCAL_CUSPARSELT_LIB_ZIP
NAMES ${CUSPARSELT_CACHE_FILENAME}
PATHS ${CUSPARSELT_DOWNLOAD_DIR}
NO_DEFAULT_PATH)
if(LOCAL_CUSPARSELT_LIB_ZIP)
if(EXISTS ${CUSPARSELT_DOWNLOAD_DIR}/${CUSPARSELT_CACHE_FILENAME})
file(MD5 ${CUSPARSELT_DOWNLOAD_DIR}/${CUSPARSELT_CACHE_FILENAME}
CUSPARSELT_MD5)
if(NOT CUSPARSELT_MD5 EQUAL CUSPARSELT_URL_MD5)
if(NOT CUSPARSELT_MD5 STREQUAL CUSPARSELT_URL_MD5)
# clean build file
file(REMOVE_RECURSE ${CUSPARSELT_PREFIX_DIR})
file(REMOVE_RECURSE ${CUSPARSELT_INSTALL_DIR})
download_cusparselt()
endif()
else()
......
......@@ -81,16 +81,13 @@ function(download_lapack)
endif()
endfunction()
find_file(
LOCAL_LAPACK_LIB_ZIP
NAMES ${LAPACK_FILE}
PATHS ${LAPACK_DOWNLOAD_DIR}
NO_DEFAULT_PATH)
# Download and check lapack.
if(LOCAL_LAPACK_LIB_ZIP)
if(EXISTS ${LAPACK_DOWNLOAD_DIR}/${LAPACK_FILE})
file(MD5 ${LAPACK_DOWNLOAD_DIR}/${LAPACK_FILE} LAPACK_MD5)
if(NOT LAPACK_MD5 EQUAL LAPACK_URL_MD5)
if(NOT LAPACK_MD5 STREQUAL LAPACK_URL_MD5)
# clean build file
file(REMOVE_RECURSE ${LAPACK_PREFIX_DIR})
file(REMOVE_RECURSE ${LAPACK_INSTALL_DIR})
download_lapack()
endif()
else()
......
......@@ -71,16 +71,13 @@ function(download_mklml)
endif()
endfunction()
find_file(
LOCAL_MKLML_LIB_ZIP
NAMES ${MKLML_FILE}
PATHS ${MKLML_DOWNLOAD_DIR}
NO_DEFAULT_PATH)
# Download and check mklml.
if(LOCAL_MKLML_LIB_ZIP)
if(EXISTS ${MKLML_DOWNLOAD_DIR}/${MKLML_FILE})
file(MD5 ${MKLML_DOWNLOAD_DIR}/${MKLML_FILE} MKLML_MD5)
if(NOT MKLML_MD5 EQUAL MKLML_URL_MD5)
if(NOT MKLML_MD5 STREQUAL MKLML_URL_MD5)
# clean build file
file(REMOVE_RECURSE ${MKLML_PREFIX_DIR})
file(REMOVE_RECURSE ${MKLML_INSTALL_DIR})
download_mklml()
endif()
else()
......
......@@ -129,16 +129,13 @@ function(download_onnxruntime)
endif()
endfunction()
find_file(
LOCAL_ONNXRUNTIME_LIB_ZIP
NAMES ${ONNXRUNTIME_CACHE_FILENAME}
PATHS ${ONNXRUNTIME_DOWNLOAD_DIR}
NO_DEFAULT_PATH)
if(LOCAL_ONNXRUNTIME_LIB_ZIP)
if(EXISTS ${ONNXRUNTIME_DOWNLOAD_DIR}/${ONNXRUNTIME_CACHE_FILENAME})
file(MD5 ${ONNXRUNTIME_DOWNLOAD_DIR}/${ONNXRUNTIME_CACHE_FILENAME}
ONNXRUNTIME_MD5)
if(NOT ONNXRUNTIME_MD5 EQUAL ONNXRUNTIME_URL_MD5)
if(NOT ONNXRUNTIME_MD5 STREQUAL ONNXRUNTIME_URL_MD5)
# clean build file
file(REMOVE_RECURSE ${ONNXRUNTIME_PREFIX_DIR})
file(REMOVE_RECURSE ${ONNXRUNTIME_INSTALL_DIR})
download_onnxruntime()
endif()
else()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册