From a6b9120a2a4e207007104eedc124f250b371983d Mon Sep 17 00:00:00 2001 From: gouzil <66515297+gouzil@users.noreply.github.com> Date: Sun, 11 Jun 2023 16:00:23 +0800 Subject: [PATCH] [cmake] fix cmake with the same name already exists (#54391) * [cmake] fix cmake error * [cmake]add rm build file --- cmake/external/lapack.cmake | 4 +++- cmake/external/libmct.cmake | 4 ++++ cmake/external/mklml.cmake | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cmake/external/lapack.cmake b/cmake/external/lapack.cmake index 78c2659a585..e0f6b0304cc 100644 --- a/cmake/external/lapack.cmake +++ b/cmake/external/lapack.cmake @@ -91,6 +91,9 @@ find_file( if(LOCAL_LAPACK_LIB_ZIP) file(MD5 ${LAPACK_DOWNLOAD_DIR}/${LAPACK_FILE} LAPACK_MD5) if(NOT LAPACK_MD5 EQUAL LAPACK_URL_MD5) + # clean build file + file(REMOVE_RECURSE ${LAPACK_PREFIX_DIR}) + file(REMOVE_RECURSE ${LAPACK_INSTALL_DIR}) download_lapack() endif() else() @@ -101,7 +104,6 @@ ExternalProject_Add( extern_lapack ${EXTERNAL_PROJECT_LOG_ARGS} URL ${LAPACK_DOWNLOAD_DIR}/${LAPACK_FILE} - URL_MD5 ${LAPACK_URL_MD5} DOWNLOAD_DIR ${LAPACK_DOWNLOAD_DIR} SOURCE_DIR ${LAPACK_LIB_DIR} PREFIX ${LAPACK_PREFIX_DIR} diff --git a/cmake/external/libmct.cmake b/cmake/external/libmct.cmake index 15ee5964209..582d3216f48 100644 --- a/cmake/external/libmct.cmake +++ b/cmake/external/libmct.cmake @@ -43,6 +43,10 @@ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${LIBMCT_ROOT}/lib") include_directories(${LIBMCT_INC_DIR}) +# clean build file +file(REMOVE_RECURSE ${LIBMCT_PREFIX_DIR}) +file(REMOVE_RECURSE ${LIBMCT_INSTALL_DIR}) + file( DOWNLOAD ${LIBMCT_URL} ${LIBMCT_DOWNLOAD_DIR}/${LIBMCT_DOWNLOAD_FILE} TLS_VERIFY OFF diff --git a/cmake/external/mklml.cmake b/cmake/external/mklml.cmake index 801cab62fac..426e5b53eb4 100644 --- a/cmake/external/mklml.cmake +++ b/cmake/external/mklml.cmake @@ -81,6 +81,9 @@ find_file( if(LOCAL_MKLML_LIB_ZIP) file(MD5 ${MKLML_DOWNLOAD_DIR}/${MKLML_FILE} MKLML_MD5) if(NOT MKLML_MD5 EQUAL MKLML_URL_MD5) + # clean build file + file(REMOVE_RECURSE ${MKLML_PREFIX_DIR}) + file(REMOVE_RECURSE ${MKLML_INSTALL_DIR}) download_mklml() endif() else() -- GitLab