diff --git a/cmake/external/cusparselt.cmake b/cmake/external/cusparselt.cmake index d1a320f8a4ff8a3dae0aa95db5f5bbc11beca32b..41d7bf23c3e7fe386fc52fdc7a901e76fcc99f13 100644 --- a/cmake/external/cusparselt.cmake +++ b/cmake/external/cusparselt.cmake @@ -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() diff --git a/cmake/external/lapack.cmake b/cmake/external/lapack.cmake index 78c2659a58504e91a3d65f36b39c9a501bd9133f..1b5032ab6ff1b409110eb10c14eadb685767eb87 100644 --- a/cmake/external/lapack.cmake +++ b/cmake/external/lapack.cmake @@ -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() diff --git a/cmake/external/mklml.cmake b/cmake/external/mklml.cmake index 801cab62facbb764029bd3b37d3e4d33c183f4ad..d5e3fa16bf0e2581f7a9ce52d2302dd976f0d9ca 100644 --- a/cmake/external/mklml.cmake +++ b/cmake/external/mklml.cmake @@ -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() diff --git a/cmake/external/onnxruntime.cmake b/cmake/external/onnxruntime.cmake index 43e67ff48c2c5c3eafd12a129dd7073dd5cd42a1..57969e8c76c8e9164281c10d6a58f22166c97476 100644 --- a/cmake/external/onnxruntime.cmake +++ b/cmake/external/onnxruntime.cmake @@ -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()