diff --git a/core/thirdparty/CMakeLists.txt b/core/thirdparty/CMakeLists.txt index 78bdffcb5a..a89129b881 100644 --- a/core/thirdparty/CMakeLists.txt +++ b/core/thirdparty/CMakeLists.txt @@ -34,23 +34,11 @@ find_package( Threads REQUIRED ) # ****************************** Thirdparty googletest *************************************** if ( MILVUS_BUILD_TESTS ) - if ( DEFINED ENV{MILVUS_GTEST_URL} ) - set( GTEST_SOURCE_URL "$ENV{MILVUS_GTEST_URL}" ) - else() - set( GTEST_SOURCE_URL - "https://gitee.com/quicksilver/googletest/repository/archive/release-${GTEST_VERSION}.zip" ) - endif() add_subdirectory( gtest ) endif() # ****************************** Thirdparty grpc *************************************** if ( MILVUS_WITH_GRPC ) - if ( DEFINED ENV{MILVUS_GRPC_URL} ) - set( GRPC_SOURCE_URL "$ENV{MILVUS_GRPC_URL}" ) - else() - set( GRPC_SOURCE_URL - "https://github.com/milvus-io/grpc-milvus/archive/${GRPC_VERSION}.zip" ) - endif() add_subdirectory( grpc ) endif () diff --git a/core/thirdparty/grpc/CMakeLists.txt b/core/thirdparty/grpc/CMakeLists.txt index 3bcd2aa11f..a36d1802a7 100644 --- a/core/thirdparty/grpc/CMakeLists.txt +++ b/core/thirdparty/grpc/CMakeLists.txt @@ -11,6 +11,13 @@ # or implied. See the License for the specific language governing permissions and limitations under the License. #------------------------------------------------------------------------------- +if ( DEFINED ENV{MILVUS_GRPC_URL} ) + set( GRPC_SOURCE_URL "$ENV{MILVUS_GRPC_URL}" ) +else() + set( GRPC_SOURCE_URL + "https://github.com/milvus-io/grpc-milvus/archive/${GRPC_VERSION}.zip" ) +endif() + message( STATUS "Building GRPC-${GRPC_VERSION} from source" ) FetchContent_Declare( grpc diff --git a/core/thirdparty/gtest/CMakeLists.txt b/core/thirdparty/gtest/CMakeLists.txt index 678b35eb29..e2e2127efe 100644 --- a/core/thirdparty/gtest/CMakeLists.txt +++ b/core/thirdparty/gtest/CMakeLists.txt @@ -11,29 +11,34 @@ # or implied. See the License for the specific language governing permissions and limitations under the License. #------------------------------------------------------------------------------- -# *********************************** FetchContent *********************************** -# Pros: Simple, done at configure time, can be used immediately -# ************************************************************************************ +if ( DEFINED ENV{MILVUS_GTEST_URL} ) + set( GTEST_SOURCE_URL "$ENV{MILVUS_GTEST_URL}" ) +else() + set( GTEST_SOURCE_URL + "https://gitee.com/quicksilver/googletest/repository/archive/release-${GTEST_VERSION}.zip" ) +endif() + message( STATUS "Building gtest-${GTEST_VERSION} from source" ) include( FetchContent ) set( CMAKE_POLICY_DEFAULT_CMP0022 NEW ) # for googletest only FetchContent_Declare( googletest - URL ${GTEST_SOURCE_URL} - URL_MD5 "f9137c5bc18b7d74027936f0f1bfa5c8" - SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-src - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-build + URL ${GTEST_SOURCE_URL} + URL_MD5 "f9137c5bc18b7d74027936f0f1bfa5c8" + SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-src + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-build ) if ( NOT googletest_POPULATED ) FetchContent_Populate( googletest ) + # Adding the following targets: + # gtest, gtest_main, gmock, gmock_main add_subdirectory( ${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} - EXCLUDE_FROM_ALL - ) + EXCLUDE_FROM_ALL ) endif() # **************************************************************** diff --git a/core/thirdparty/yaml-cpp/CMakeLists.txt b/core/thirdparty/yaml-cpp/CMakeLists.txt index 8b36cae013..03f58507be 100644 --- a/core/thirdparty/yaml-cpp/CMakeLists.txt +++ b/core/thirdparty/yaml-cpp/CMakeLists.txt @@ -15,8 +15,7 @@ if ( DEFINED ENV{MILVUS_YAMLCPP_URL} ) set( YAMLCPP_SOURCE_URL "$ENV{MILVUS_YAMLCPP_URL}" ) else() set( YAMLCPP_SOURCE_URL - "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-${YAMLCPP_VERSION}.tar.gz" - "https://gitee.com/quicksilver/yaml-cpp/repository/archive/yaml-cpp-${YAMLCPP_VERSION}.zip" ) + "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-${YAMLCPP_VERSION}.tar.gz" ) endif() message( STATUS "Building yaml-cpp-${YAMLCPP_VERSION} from source" )