Skip to content

Commit

Permalink
Fix cmake typo
Browse files Browse the repository at this point in the history
Signed-off-by: yhmo <[email protected]>
  • Loading branch information
yhmo committed Jan 16, 2025
1 parent f5760ce commit 593a340
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmake/MilvusProtoGen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_FILE:protoc>)
set(Protobuf_PROTOC_EXECUTABLE $<TARGET_FILE:protobuf::protoc>)
message(STATUS "using protoc: ${Protobuf_PROTOC_EXECUTABLE}")

# resolve grpc_cpp_plugin
set(GRPC_CPP_PLUGIN $<TARGET_FILE:grpc_cpp_plugin>)
set(GRPC_CPP_PLUGIN $<TARGET_FILE:gRPC::grpc_cpp_plugin>)
message(STATUS "using grpc_cpp_plugin: ${GRPC_CPP_PLUGIN}")


Expand Down
13 changes: 11 additions & 2 deletions cmake/ThirdPartyPackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,40 @@ 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
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
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")
Expand All @@ -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 ()

Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 593a340

Please sign in to comment.