Skip to content

Commit 32b31fa

Browse files
authored
Revert find_package logic (#295)
1 parent c428bb5 commit 32b31fa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ find_package(gRPC ${VIAMCPPSDK_GRPC_VERSION_MINIMUM} CONFIG)
358358
# no version here and check it manually below.
359359
find_package(Protobuf CONFIG)
360360

361-
if (gRPC_FOUND AND Protobuf_FOUND)
361+
if (gRPC_FOUND)
362362
get_target_property(VIAMCPPSDK_GRPC_CPP_PLUGIN gRPC::grpc_cpp_plugin LOCATION)
363363
set(VIAMCPPSDK_PROTOBUF_VERSION ${Protobuf_VERSION})
364364

@@ -378,7 +378,7 @@ if (gRPC_FOUND AND Protobuf_FOUND)
378378
set(VIAMCPPSDK_GRPCXX_VERSION ${gRPC_VERSION})
379379
set(VIAMCPPSDK_GRPCXX_LIBRARIES gRPC::grpc++)
380380
set(VIAMCPPSDK_GRPCXX_REFLECTION_LIBRARIES gRPC::grpc++_reflection)
381-
elseif((NOT gRPC_FOUND) AND (NOT Protobuf_FOUND))
381+
else()
382382
message(WARNING "Failed to find gRPC with `find_package`; falling back to `pkg_check_modules`")
383383

384384
include(FindPkgConfig)
@@ -414,8 +414,6 @@ elseif((NOT gRPC_FOUND) AND (NOT Protobuf_FOUND))
414414
set(VIAMCPPSDK_GRPCXX_REFLECTION_LIBRARIES ${VIAMCPPSDK_GRPCXX_LIBRARIES})
415415
set(VIAMCPPSDK_GRPCXX_REFLECTION_LIB ${VIAMCPPSDK_GRPCXX_ROOT}_reflection)
416416
list(PREPEND VIAMCPPSDK_GRPCXX_REFLECTION_LIBRARIES ${VIAMCPPSDK_GRPCXX_REFLECTION_LIB})
417-
else()
418-
message(FATAL_ERROR "Unexpected combination of find_package and pkg-config protobuf and gRPC")
419417
endif()
420418

421419
# Do this here unconditionally in case find_package didn't set the MAJOR/MINOR variables

0 commit comments

Comments
 (0)