diff --git a/cmake/MilvusProtoGen.cmake b/cmake/MilvusProtoGen.cmake index b2f0346..af0e199 100644 --- a/cmake/MilvusProtoGen.cmake +++ b/cmake/MilvusProtoGen.cmake @@ -32,11 +32,11 @@ set(PROTO_BINARY_DIR "${milvus_proto_BINARY_DIR}") set(PROTO_IMPORT_DIR "${milvus_proto_SOURCE_DIR}/proto") # resolve protoc, always use the protoc in the build tree -set(Protobuf_PROTOC_EXECUTABLE $) +set(Protobuf_PROTOC_EXECUTABLE $) message(STATUS "using protoc: ${Protobuf_PROTOC_EXECUTABLE}") # resolve grpc_cpp_plugin -set(GRPC_CPP_PLUGIN $) +set(GRPC_CPP_PLUGIN $) message(STATUS "using grpc_cpp_plugin: ${GRPC_CPP_PLUGIN}") diff --git a/cmake/ThirdPartyPackages.cmake b/cmake/ThirdPartyPackages.cmake index ab9c619..fefd8c8 100644 --- a/cmake/ThirdPartyPackages.cmake +++ b/cmake/ThirdPartyPackages.cmake @@ -21,12 +21,15 @@ include(FetchContent) set(GRPC_VERSION 1.49.1) set(NLOHMANN_JSON_VERSION 3.11.3) set(GOOGLETEST_VERSION 1.12.1) +Set(FETCHCONTENT_QUIET FALSE) # grpc FetchContent_Declare( grpc GIT_REPOSITORY https://github.com/grpc/grpc.git GIT_TAG v${GRPC_VERSION} + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE ) # nlohmann_json @@ -34,6 +37,8 @@ FetchContent_Declare( nlohmann_json GIT_REPOSITORY https://github.com/nlohmann/json.git GIT_TAG v${NLOHMANN_JSON_VERSION} + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE ) # googletest @@ -41,12 +46,15 @@ FetchContent_Declare( googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG release-${GOOGLETEST_VERSION} + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE ) # grpc -if ("${MILVUS_WITH_GRPC}" STREQUAL "pakcage") - find_package(grpc REQUIRED) +if ("${MILVUS_WITH_GRPC}" STREQUAL "package") + find_package(Protobuf REQUIRED) + find_package(gRPC REQUIRED) else () if (WIN32) set(OPENSSL_NO_ASM_TXT "YES") @@ -66,6 +74,7 @@ else () set(ABSL_PROPAGATE_CXX_STD ON CACHE INTERNAL "") add_subdirectory(${grpc_SOURCE_DIR} ${grpc_BINARY_DIR} EXCLUDE_FROM_ALL) add_library(gRPC::grpc++ ALIAS grpc++) + add_executable(gRPC::grpc_cpp_plugin ALIAS grpc_cpp_plugin) endif () endif () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5f18c37..e7a9800 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -19,7 +19,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src/impl) include_directories(${milvus_proto_BINARY_DIR}) # resolve gtest -if ("${MILVUS_WITH_GTEST}" STREQUAL "pakcage") +if ("${MILVUS_WITH_GTEST}" STREQUAL "package") find_package(GTest REQUIRED) else () if (NOT googletest_POPULATED)