From da5fb1d4616fde348ee39a1e28ee6b4d4f0ac4b8 Mon Sep 17 00:00:00 2001 From: Sing_chan <51314274+betterpig@users.noreply.github.com> Date: Fri, 19 Nov 2021 17:53:42 +0800 Subject: [PATCH] make third_party's cmake get source code directly (#37332) --- cmake/external/cryptopp.cmake | 8 ++------ cmake/external/dgc.cmake | 6 +----- cmake/external/dlpack.cmake | 8 ++------ cmake/external/eigen.cmake | 12 ++++-------- cmake/external/gflags.cmake | 8 ++------ cmake/external/glog.cmake | 8 ++------ cmake/external/gloo.cmake | 11 ++++------- cmake/external/gtest.cmake | 8 ++------ cmake/external/mkldnn.cmake | 8 ++------ 9 files changed, 21 insertions(+), 56 deletions(-) diff --git a/cmake/external/cryptopp.cmake b/cmake/external/cryptopp.cmake index aedd40aec6..4c3bca56f3 100644 --- a/cmake/external/cryptopp.cmake +++ b/cmake/external/cryptopp.cmake @@ -52,16 +52,12 @@ set(CRYPTOPP_CMAKE_ARGS ${COMMON_CMAKE_ARGS} INCLUDE_DIRECTORIES(${CRYPTOPP_INCLUDE_DIR}) -cache_third_party(extern_cryptopp - REPOSITORY ${CRYPTOPP_REPOSITORY} - TAG ${CRYPTOPP_TAG} - DIR CRYPTOPP_SOURCE_DIR) - ExternalProject_Add( extern_cryptopp ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - "${CRYPTOPP_DOWNLOAD_CMD}" + GIT_REPOSITORY ${CRYPTOPP_REPOSITORY} + GIT_TAG ${CRYPTOPP_TAG} PREFIX ${CRYPTOPP_PREFIX_DIR} SOURCE_DIR ${CRYPTOPP_SOURCE_DIR} UPDATE_COMMAND "" diff --git a/cmake/external/dgc.cmake b/cmake/external/dgc.cmake index 3c64e1ea11..655611e06e 100644 --- a/cmake/external/dgc.cmake +++ b/cmake/external/dgc.cmake @@ -22,14 +22,10 @@ SET(DGC_LIBRARIES "${DGC_INSTALL_DIR}/lib/libdgc.a" CACHE FILEPATH "dgc librar SET(DGC_URL "https://fleet.bj.bcebos.com/dgc/collective_f66ef73.tgz") INCLUDE_DIRECTORIES(${DGC_INCLUDE_DIR}) -cache_third_party(extern_dgc - URL ${DGC_URL} - DIR DGC_SOURCES_DIR) - ExternalProject_Add( extern_dgc ${EXTERNAL_PROJECT_LOG_ARGS} - "${DGC_DOWNLOAD_CMD}" + URL ${DGC_URL} URL_MD5 "94e6fa1bc97169d0e1aad44570fe3251" PREFIX "${DGC_PREFIX_DIR}" SOURCE_DIR "${DGC_SOURCES_DIR}" diff --git a/cmake/external/dlpack.cmake b/cmake/external/dlpack.cmake index 43ffde7599..be97a026e2 100644 --- a/cmake/external/dlpack.cmake +++ b/cmake/external/dlpack.cmake @@ -20,11 +20,6 @@ set(DLPACK_SOURCE_DIR ${THIRD_PARTY_PATH}/dlpack/src/extern_dlpack) set(DLPACK_REPOSITORY ${GIT_URL}/dmlc/dlpack.git) set(DLPACK_TAG v0.4) -cache_third_party(extern_dlpack - REPOSITORY ${DLPACK_REPOSITORY} - TAG ${DLPACK_TAG} - DIR DLPACK_SOURCE_DIR) - set(DLPACK_INCLUDE_DIR ${DLPACK_SOURCE_DIR}/include) include_directories(${DLPACK_INCLUDE_DIR}) @@ -32,7 +27,8 @@ ExternalProject_Add( extern_dlpack ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - "${DLPACK_DOWNLOAD_CMD}" + GIT_REPOSITORY ${DLPACK_REPOSITORY} + GIT_TAG ${DLPACK_TAG} PREFIX ${DLPACK_PREFIX_DIR} SOURCE_DIR ${DLPACK_SOURCE_DIR} UPDATE_COMMAND "" diff --git a/cmake/external/eigen.cmake b/cmake/external/eigen.cmake index aa471002ea..9293b3ebce 100644 --- a/cmake/external/eigen.cmake +++ b/cmake/external/eigen.cmake @@ -20,11 +20,6 @@ set(EIGEN_SOURCE_DIR ${THIRD_PARTY_PATH}/eigen3/src/extern_eigen3) set(EIGEN_REPOSITORY https://gitlab.com/libeigen/eigen.git) set(EIGEN_TAG f612df273689a19d25b45ca4f8269463207c4fee) -cache_third_party(extern_eigen3 - REPOSITORY ${EIGEN_REPOSITORY} - TAG ${EIGEN_TAG} - DIR EIGEN_SOURCE_DIR) - if(WIN32) add_definitions(-DEIGEN_STRONG_INLINE=inline) elseif(LINUX) @@ -46,9 +41,10 @@ ExternalProject_Add( extern_eigen3 ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - "${EIGEN_DOWNLOAD_CMD}" - PREFIX ${EIGEN_PREFIX_DIR} - SOURCE_DIR ${EIGEN_SOURCE_DIR} + GIT_REPOSITORY ${EIGEN_REPOSITORY} + GIT_TAG ${EIGEN_TAG} + PREFIX ${EIGEN_PREFIX_DIR} + SOURCE_DIR ${EIGEN_SOURCE_DIR} UPDATE_COMMAND "" PATCH_COMMAND ${EIGEN_PATCH_COMMAND} CONFIGURE_COMMAND "" diff --git a/cmake/external/gflags.cmake b/cmake/external/gflags.cmake index 0f9739014d..e4e4757206 100644 --- a/cmake/external/gflags.cmake +++ b/cmake/external/gflags.cmake @@ -30,16 +30,12 @@ ENDIF(WIN32) INCLUDE_DIRECTORIES(${GFLAGS_INCLUDE_DIR}) -cache_third_party(extern_gflags - REPOSITORY ${GFLAGS_REPOSITORY} - TAG ${GFLAGS_TAG} - DIR GFLAGS_SOURCE_DIR) - ExternalProject_Add( extern_gflags ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - "${GFLAGS_DOWNLOAD_CMD}" + GIT_REPOSITORY ${GFLAGS_REPOSITORY} + GIT_TAG ${GFLAGS_TAG} PREFIX ${GFLAGS_PREFIX_DIR} UPDATE_COMMAND "" SOURCE_DIR ${GFLAGS_SOURCE_DIR} diff --git a/cmake/external/glog.cmake b/cmake/external/glog.cmake index b9dbe90a92..2897b54bd6 100644 --- a/cmake/external/glog.cmake +++ b/cmake/external/glog.cmake @@ -32,16 +32,12 @@ ENDIF(WIN32) INCLUDE_DIRECTORIES(${GLOG_INCLUDE_DIR}) -cache_third_party(extern_glog - REPOSITORY ${GLOG_REPOSITORY} - TAG ${GLOG_TAG} - DIR GLOG_SOURCE_DIR) - ExternalProject_Add( extern_glog ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - "${GLOG_DOWNLOAD_CMD}" + GIT_REPOSITORY ${GLOG_REPOSITORY} + GIT_TAG ${GLOG_TAG} DEPENDS gflags PREFIX ${GLOG_PREFIX_DIR} SOURCE_DIR ${GLOG_SOURCE_DIR} diff --git a/cmake/external/gloo.cmake b/cmake/external/gloo.cmake index 03e45e3e5c..8d4b0c4ebf 100644 --- a/cmake/external/gloo.cmake +++ b/cmake/external/gloo.cmake @@ -27,17 +27,13 @@ SET(GLOO_LIBRARIES "${GLOO_INSTALL_DIR}/lib/libgloo.a" CACHE FILEPATH "gloo INCLUDE_DIRECTORIES(${GLOO_INCLUDE_DIR}) -cache_third_party(extern_gloo - REPOSITORY ${GLOO_REPOSITORY} - TAG ${GLOO_TAG} - DIR GLOO_SOURCE_DIR) - if(WITH_ASCEND OR WITH_ASCEND_CL) ExternalProject_Add( extern_gloo ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - "${GLOO_DOWNLOAD_CMD}" + GIT_REPOSITORY ${GLOO_REPOSITORY} + GIT_TAG ${GLOO_TAG} PREFIX "${GLOO_PREFIX_DIR}" SOURCE_DIR "${GLOO_SOURCE_DIR}" UPDATE_COMMAND "" @@ -54,7 +50,8 @@ else() extern_gloo ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - "${GLOO_DOWNLOAD_CMD}" + GIT_REPOSITORY ${GLOO_REPOSITORY} + GIT_TAG ${GLOO_TAG} PREFIX "${GLOO_PREFIX_DIR}" SOURCE_DIR "${GLOO_SOURCE_DIR}" UPDATE_COMMAND "" diff --git a/cmake/external/gtest.cmake b/cmake/external/gtest.cmake index e7d4783a95..9758d8a7e4 100644 --- a/cmake/external/gtest.cmake +++ b/cmake/external/gtest.cmake @@ -47,16 +47,12 @@ IF(WITH_MKLML) SET(GTEST_DEPENDS ${MKLML_PROJECT}) ENDIF() -cache_third_party(extern_gtest - REPOSITORY ${GTEST_REPOSITORY} - TAG ${GTEST_TAG} - DIR GTEST_SOURCE_DIR) - ExternalProject_Add( extern_gtest ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - "${GTEST_DOWNLOAD_CMD}" + GIT_REPOSITORY ${GTEST_REPOSITORY} + GIT_TAG ${GTEST_TAG} DEPENDS ${GTEST_DEPENDS} PREFIX ${GTEST_PREFIX_DIR} SOURCE_DIR ${GTEST_SOURCE_DIR} diff --git a/cmake/external/mkldnn.cmake b/cmake/external/mkldnn.cmake index 3d041b1094..d004354338 100644 --- a/cmake/external/mkldnn.cmake +++ b/cmake/external/mkldnn.cmake @@ -49,16 +49,12 @@ ELSE() SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/bin/mkldnn.lib" CACHE FILEPATH "mkldnn library." FORCE) ENDIF(NOT WIN32) -cache_third_party(${MKLDNN_PROJECT} - REPOSITORY ${MKLDNN_REPOSITORY} - TAG ${MKLDNN_TAG} - DIR MKLDNN_SOURCE_DIR) - ExternalProject_Add( ${MKLDNN_PROJECT} ${EXTERNAL_PROJECT_LOG_ARGS} ${SHALLOW_CLONE} - "${MKLDNN_DOWNLOAD_CMD}" + GIT_REPOSITORY ${MKLDNN_REPOSITORY} + GIT_TAG ${MKLDNN_TAG} DEPENDS ${MKLDNN_DEPENDS} PREFIX ${MKLDNN_PREFIX_DIR} SOURCE_DIR ${MKLDNN_SOURCE_DIR} -- GitLab